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

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

Issue 1641163005: [Draft] try out the idea of adding export macros for C++ bindings. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « mojo/public/cpp/bindings/tests/BUILD.gn ('k') | mojo/public/interfaces/bindings/tests/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <string.h> 7 #include <string.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h" 10 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
11 #include "mojo/public/cpp/system/message_pipe.h" 11 #include "mojo/public/cpp/system/message_pipe.h"
12 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" 12 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace test { 16 namespace test {
17 namespace { 17 namespace {
18 18
19 RectPtr MakeRect(int32_t factor = 1) { 19 RectPtr __declspec(dllexport) MakeRect(int32_t factor = 1) {
20 RectPtr rect(Rect::New()); 20 RectPtr rect(Rect::New());
21 rect->x = 1 * factor; 21 rect->x = 1 * factor;
22 rect->y = 2 * factor; 22 rect->y = 2 * factor;
23 rect->width = 10 * factor; 23 rect->width = 10 * factor;
24 rect->height = 20 * factor; 24 rect->height = 20 * factor;
25 return rect; 25 return rect;
26 } 26 }
27 27
28 void CheckRect(const Rect& rect, int32_t factor = 1) { 28 void CheckRect(const Rect& rect, int32_t factor = 1) {
29 EXPECT_EQ(1 * factor, rect.x); 29 EXPECT_EQ(1 * factor, rect.x);
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 expected_output->f_int32 = 123; 409 expected_output->f_int32 = 123;
410 410
411 MultiVersionStructV0Ptr output = 411 MultiVersionStructV0Ptr output =
412 SerializeAndDeserialize<MultiVersionStructV0Ptr>(std::move(input)); 412 SerializeAndDeserialize<MultiVersionStructV0Ptr>(std::move(input));
413 EXPECT_TRUE(output); 413 EXPECT_TRUE(output);
414 EXPECT_TRUE(output->Equals(*expected_output)); 414 EXPECT_TRUE(output->Equals(*expected_output));
415 } 415 }
416 } 416 }
417 } // namespace test 417 } // namespace test
418 } // namespace mojo 418 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/BUILD.gn ('k') | mojo/public/interfaces/bindings/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698