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

Unified Diff: mojo/public/cpp/bindings/tests/hash_unittest.cc

Issue 2689513003: Add field-initializing constructors to generated mojo structs. (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/hash_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/hash_unittest.cc b/mojo/public/cpp/bindings/tests/hash_unittest.cc
index dac3decf95303efe7461518ddebd36e3a3d06c02..9ce1f5bc7b7e73cd695df2efb6ec729bd9fa9ec3 100644
--- a/mojo/public/cpp/bindings/tests/hash_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/hash_unittest.cc
@@ -13,25 +13,13 @@ namespace {
using HashTest = testing::Test;
-static ContainsOtherPtr MakeContainsOther(uint64_t other) {
- ContainsOtherPtr ptr = ContainsOther::New();
- ptr->other = other;
- return ptr;
-}
-
-static SimpleNestedStructPtr MakeSimpleNestedStruct(ContainsOtherPtr nested) {
- SimpleNestedStructPtr ptr = SimpleNestedStruct::New();
- ptr->nested = std::move(nested);
- return ptr;
-}
-
TEST_F(HashTest, NestedStruct) {
// Just check that this template instantiation compiles.
ASSERT_EQ(
::mojo::internal::Hash(::mojo::internal::kHashSeed,
- MakeSimpleNestedStruct(MakeContainsOther(1))),
+ SimpleNestedStruct::New(ContainsOther::New(1))),
::mojo::internal::Hash(::mojo::internal::kHashSeed,
- MakeSimpleNestedStruct(MakeContainsOther(1))));
+ SimpleNestedStruct::New(ContainsOther::New(1))));
}
TEST_F(HashTest, UnmappedNativeStruct) {
« no previous file with comments | « mojo/public/cpp/bindings/tests/handle_passing_unittest.cc ('k') | mojo/public/cpp/bindings/tests/pickle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698