OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/values.h" | 5 #include "base/values.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <type_traits> | 12 #include <type_traits> |
13 #include <utility> | 13 #include <utility> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 | 22 |
23 TEST(ValuesTest, TestNothrow) { | 23 TEST(ValuesTest, TestNothrow) { |
24 static_assert(std::is_nothrow_move_constructible<Value>::value, | |
25 "IsNothrowMoveConstructible"); | |
26 static_assert(std::is_nothrow_default_constructible<Value>::value, | 24 static_assert(std::is_nothrow_default_constructible<Value>::value, |
27 "IsNothrowDefaultConstructible"); | 25 "IsNothrowDefaultConstructible"); |
28 static_assert(std::is_nothrow_constructible<Value, std::string&&>::value, | 26 static_assert(std::is_nothrow_constructible<Value, std::string&&>::value, |
29 "IsNothrowMoveConstructibleFromString"); | 27 "IsNothrowMoveConstructibleFromString"); |
30 static_assert( | 28 static_assert( |
31 std::is_nothrow_constructible<Value, std::vector<char>&&>::value, | 29 std::is_nothrow_constructible<Value, std::vector<char>&&>::value, |
32 "IsNothrowMoveConstructibleFromBlob"); | 30 "IsNothrowMoveConstructibleFromBlob"); |
33 static_assert(std::is_nothrow_move_assignable<Value>::value, | 31 static_assert(std::is_nothrow_move_assignable<Value>::value, |
34 "IsNothrowMoveAssignable"); | 32 "IsNothrowMoveAssignable"); |
35 } | 33 } |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 EXPECT_FALSE(main_list.GetList(7, NULL)); | 1515 EXPECT_FALSE(main_list.GetList(7, NULL)); |
1518 } | 1516 } |
1519 | 1517 |
1520 TEST(ValuesTest, SelfSwap) { | 1518 TEST(ValuesTest, SelfSwap) { |
1521 base::Value test(1); | 1519 base::Value test(1); |
1522 std::swap(test, test); | 1520 std::swap(test, test); |
1523 EXPECT_TRUE(test.GetInt() == 1); | 1521 EXPECT_TRUE(test.GetInt() == 1); |
1524 } | 1522 } |
1525 | 1523 |
1526 } // namespace base | 1524 } // namespace base |
OLD | NEW |