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

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

Issue 644963004: Some more virtual/override updates. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 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 "mojo/public/cpp/bindings/array.h" 5 #include "mojo/public/cpp/bindings/array.h"
6 #include "mojo/public/cpp/bindings/lib/array_internal.h" 6 #include "mojo/public/cpp/bindings/lib/array_internal.h"
7 #include "mojo/public/cpp/bindings/lib/array_serialization.h" 7 #include "mojo/public/cpp/bindings/lib/array_serialization.h"
8 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h" 8 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
9 #include "mojo/public/cpp/bindings/tests/container_test_util.h" 9 #include "mojo/public/cpp/bindings/tests/container_test_util.h"
10 #include "mojo/public/cpp/environment/environment.h" 10 #include "mojo/public/cpp/environment/environment.h"
11 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" 11 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace test { 15 namespace test {
16 namespace { 16 namespace {
17 17
18 using mojo::internal::Array_Data; 18 using mojo::internal::Array_Data;
19 using mojo::internal::ArrayValidateParams; 19 using mojo::internal::ArrayValidateParams;
20 using mojo::internal::FixedBuffer; 20 using mojo::internal::FixedBuffer;
21 using mojo::internal::NoValidateParams; 21 using mojo::internal::NoValidateParams;
22 using mojo::internal::String_Data; 22 using mojo::internal::String_Data;
23 23
24 class ArrayTest : public testing::Test { 24 class ArrayTest : public testing::Test {
25 public: 25 public:
26 virtual ~ArrayTest() {} 26 ~ArrayTest() override {}
27 27
28 private: 28 private:
29 Environment env_; 29 Environment env_;
30 }; 30 };
31 31
32 // Tests that basic Array operations work. 32 // Tests that basic Array operations work.
33 TEST_F(ArrayTest, Basic) { 33 TEST_F(ArrayTest, Basic) {
34 Array<char> array(8); 34 Array<char> array(8);
35 for (size_t i = 0; i < array.size(); ++i) { 35 for (size_t i = 0; i < array.size(); ++i) {
36 char val = static_cast<char>(i * 2); 36 char val = static_cast<char>(i * 2);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 EXPECT_TRUE(array[i].moved()); 441 EXPECT_TRUE(array[i].moved());
442 EXPECT_EQ(value_ptrs[i], array[i].ptr()); 442 EXPECT_EQ(value_ptrs[i], array[i].ptr());
443 } 443 }
444 array.reset(); 444 array.reset();
445 EXPECT_EQ(0u, MoveOnlyType::num_instances()); 445 EXPECT_EQ(0u, MoveOnlyType::num_instances());
446 } 446 }
447 447
448 } // namespace 448 } // namespace
449 } // namespace test 449 } // namespace test
450 } // namespace mojo 450 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/c/system/tests/core_perftest.cc ('k') | mojo/public/cpp/bindings/tests/connector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698