| Index: mojo/public/cpp/bindings/tests/map_unittest.cc
|
| diff --git a/mojo/public/cpp/bindings/tests/map_unittest.cc b/mojo/public/cpp/bindings/tests/map_unittest.cc
|
| index e13878bdceda2195a93169773e4a30e3913e1e75..444e0b375dfa74b1f524b04c6edf8483458fac70 100644
|
| --- a/mojo/public/cpp/bindings/tests/map_unittest.cc
|
| +++ b/mojo/public/cpp/bindings/tests/map_unittest.cc
|
| @@ -2,15 +2,17 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "mojo/public/cpp/bindings/map.h"
|
| +
|
| #include <stddef.h>
|
| #include <stdint.h>
|
| +#include <utility>
|
|
|
| #include "mojo/public/cpp/bindings/array.h"
|
| #include "mojo/public/cpp/bindings/lib/array_serialization.h"
|
| #include "mojo/public/cpp/bindings/lib/bindings_internal.h"
|
| #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
|
| #include "mojo/public/cpp/bindings/lib/validate_params.h"
|
| -#include "mojo/public/cpp/bindings/map.h"
|
| #include "mojo/public/cpp/bindings/string.h"
|
| #include "mojo/public/cpp/bindings/tests/container_test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -82,7 +84,7 @@ TEST_F(MapTest, TestIndexOperatorMoveOnly) {
|
| const char* key = kStringIntData[i].string_data;
|
| Array<int32_t> array(1);
|
| array[0] = kStringIntData[i].int_data;
|
| - map[key] = array.Pass();
|
| + map[key] = std::move(array);
|
| EXPECT_TRUE(map);
|
| }
|
|
|
| @@ -103,7 +105,7 @@ TEST_F(MapTest, ConstructedFromArray) {
|
| values[i] = kStringIntData[i].int_data;
|
| }
|
|
|
| - Map<String, int> map(keys.Pass(), values.Pass());
|
| + Map<String, int> map(std::move(keys), std::move(values));
|
|
|
| for (size_t i = 0; i < kStringIntDataSize; ++i) {
|
| EXPECT_EQ(kStringIntData[i].int_data,
|
| @@ -119,7 +121,7 @@ TEST_F(MapTest, DecomposeMapTo) {
|
| values[i] = kStringIntData[i].int_data;
|
| }
|
|
|
| - Map<String, int> map(keys.Pass(), values.Pass());
|
| + Map<String, int> map(std::move(keys), std::move(values));
|
| EXPECT_EQ(kStringIntDataSize, map.size());
|
|
|
| Array<String> keys2;
|
| @@ -184,7 +186,7 @@ TEST_F(MapTest, Insert_MoveOnly) {
|
| const char* key = kStringIntData[i].string_data;
|
| MoveOnlyType value;
|
| value_ptrs.push_back(value.ptr());
|
| - map.insert(key, value.Pass());
|
| + map.insert(key, std::move(value));
|
| ASSERT_EQ(i + 1, map.size());
|
| ASSERT_EQ(i + 1, value_ptrs.size());
|
| EXPECT_EQ(map.size() + 1, MoveOnlyType::num_instances());
|
| @@ -210,7 +212,7 @@ TEST_F(MapTest, IndexOperator_MoveOnly) {
|
| const char* key = kStringIntData[i].string_data;
|
| MoveOnlyType value;
|
| value_ptrs.push_back(value.ptr());
|
| - map[key] = value.Pass();
|
| + map[key] = std::move(value);
|
| ASSERT_EQ(i + 1, map.size());
|
| ASSERT_EQ(i + 1, value_ptrs.size());
|
| EXPECT_EQ(map.size() + 1, MoveOnlyType::num_instances());
|
| @@ -258,7 +260,7 @@ TEST_F(MapTest, MapArrayClone) {
|
| for (size_t i = 0; i < kStringIntDataSize; ++i) {
|
| Array<String> s;
|
| s.push_back(kStringIntData[i].string_data);
|
| - m.insert(kStringIntData[i].string_data, s.Pass());
|
| + m.insert(kStringIntData[i].string_data, std::move(s));
|
| }
|
|
|
| Map<String, Array<String>> m2 = m.Clone();
|
| @@ -279,7 +281,7 @@ TEST_F(MapTest, ArrayOfMap) {
|
| Array_Data<Map_Data<int32_t, int8_t>*>* data;
|
| ArrayValidateParams validate_params(
|
| 0, false, new ArrayValidateParams(0, false, nullptr));
|
| - SerializeArray_(array.Pass(), &buf, &data, &validate_params);
|
| + SerializeArray_(std::move(array), &buf, &data, &validate_params);
|
|
|
| Array<Map<int32_t, int8_t>> deserialized_array;
|
| Deserialize_(data, &deserialized_array, nullptr);
|
| @@ -294,7 +296,7 @@ TEST_F(MapTest, ArrayOfMap) {
|
| Array<bool> map_value(2);
|
| map_value[0] = false;
|
| map_value[1] = true;
|
| - array[0].insert("hello world", map_value.Pass());
|
| + array[0].insert("hello world", std::move(map_value));
|
|
|
| size_t size = GetSerializedSize_(array);
|
| FixedBufferForTesting buf(size);
|
| @@ -302,7 +304,7 @@ TEST_F(MapTest, ArrayOfMap) {
|
| ArrayValidateParams validate_params(
|
| 0, false, new ArrayValidateParams(
|
| 0, false, new ArrayValidateParams(0, false, nullptr)));
|
| - SerializeArray_(array.Pass(), &buf, &data, &validate_params);
|
| + SerializeArray_(std::move(array), &buf, &data, &validate_params);
|
|
|
| Array<Map<String, Array<bool>>> deserialized_array;
|
| Deserialize_(data, &deserialized_array, nullptr);
|
|
|