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

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

Issue 317073005: Mojom: Add 'default' keyword for initializing structs to non-null value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
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 <algorithm> 5 #include <algorithm>
6 #include <ostream> 6 #include <ostream>
7 #include <string> 7 #include <string>
8 8
9 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" 9 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 EXPECT_EQ(1234, defaults->a10); 352 EXPECT_EQ(1234, defaults->a10);
353 EXPECT_TRUE(defaults->a11); 353 EXPECT_TRUE(defaults->a11);
354 EXPECT_FALSE(defaults->a12); 354 EXPECT_FALSE(defaults->a12);
355 EXPECT_FLOAT_EQ(123.25f, defaults->a13); 355 EXPECT_FLOAT_EQ(123.25f, defaults->a13);
356 EXPECT_DOUBLE_EQ(1234567890.123, defaults->a14); 356 EXPECT_DOUBLE_EQ(1234567890.123, defaults->a14);
357 EXPECT_DOUBLE_EQ(1E10, defaults->a15); 357 EXPECT_DOUBLE_EQ(1E10, defaults->a15);
358 EXPECT_DOUBLE_EQ(-1.2E+20, defaults->a16); 358 EXPECT_DOUBLE_EQ(-1.2E+20, defaults->a16);
359 EXPECT_DOUBLE_EQ(1.23E-20, defaults->a17); 359 EXPECT_DOUBLE_EQ(1.23E-20, defaults->a17);
360 EXPECT_TRUE(defaults->a18.is_null()); 360 EXPECT_TRUE(defaults->a18.is_null());
361 EXPECT_TRUE(defaults->a19.is_null()); 361 EXPECT_TRUE(defaults->a19.is_null());
362 // TODO(mpcomplete): Test defaults.Point and defaults.Thing once we can
363 // initialize them to "default".
364 EXPECT_EQ(Bar::TYPE_BOTH, defaults->a20); 362 EXPECT_EQ(Bar::TYPE_BOTH, defaults->a20);
363 EXPECT_TRUE(defaults->a21.is_null());
364 ASSERT_FALSE(defaults->a22.is_null());
365 EXPECT_EQ(imported::SHAPE_RECTANGLE, defaults->a22->shape);
366 EXPECT_EQ(imported::COLOR_BLACK, defaults->a22->color);
365 } 367 }
366 368
367 } // namespace 369 } // namespace
368 } // namespace sample 370 } // namespace sample
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/sample_service_unittests.js ('k') | mojo/public/interfaces/bindings/tests/sample_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698