Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: mojo/public/c/tests/bindings/struct_unittest.cc

Issue 2234063002: Move the C bindings tests to the new location. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_mojo_bindings
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // TODO(vardhan): Needs a lot more testing. 5 // TODO(vardhan): Needs a lot more testing.
6 6
7 #include <mojo/bindings/struct.h> 7 #include <mojo/bindings/struct.h>
8 8
9 #include <mojo/bindings/array.h> 9 #include <mojo/bindings/array.h>
10 #include <mojo/bindings/internal/util.h> 10 #include <mojo/bindings/internal/util.h>
11 #include <string.h> 11 #include <string.h>
12 12
13 #include "mojo/public/c/bindings/tests/testing_util.h" 13 #include "mojo/public/c/tests/bindings/testing_util.h"
14 #include "mojo/public/cpp/system/macros.h" 14 #include "mojo/public/cpp/system/macros.h"
15 #include "mojo/public/interfaces/bindings/tests/rect.mojom-c.h" 15 #include "mojo/public/interfaces/bindings/tests/rect.mojom-c.h"
16 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom-c.h" 16 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom-c.h"
17 #include "mojo/public/interfaces/bindings/tests/test_unions.mojom-c.h" 17 #include "mojo/public/interfaces/bindings/tests/test_unions.mojom-c.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 namespace { 20 namespace {
21 21
22 #define BYTES_LEFT_AFTER_FIELD(type, field) \ 22 #define BYTES_LEFT_AFTER_FIELD(type, field) \
23 (sizeof(type) - offsetof(type, field)) 23 (sizeof(type) - offsetof(type, field))
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 copied_struct = 356 copied_struct =
357 mojo_test_NullableHandleStruct_DeepCopy(&buf, &handle_struct); 357 mojo_test_NullableHandleStruct_DeepCopy(&buf, &handle_struct);
358 ASSERT_TRUE(copied_struct); 358 ASSERT_TRUE(copied_struct);
359 // The old and the new copy should both have the handles. 359 // The old and the new copy should both have the handles.
360 EXPECT_EQ(static_cast<MojoHandle>(123), handle_struct.h); 360 EXPECT_EQ(static_cast<MojoHandle>(123), handle_struct.h);
361 EXPECT_EQ(static_cast<MojoHandle>(123), copied_struct->h); 361 EXPECT_EQ(static_cast<MojoHandle>(123), copied_struct->h);
362 } 362 }
363 } 363 }
364 364
365 } // namespace 365 } // namespace
OLDNEW
« no previous file with comments | « mojo/public/c/tests/bindings/message_unittest.cc ('k') | mojo/public/c/tests/bindings/testing_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698