OLD | NEW |
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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "device/bluetooth/bluetooth_uuid.h" | 6 #include "device/bluetooth/bluetooth_uuid.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace device { | 9 namespace device { |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 { "1ABC", k16Bit }, | 88 { "1ABC", k16Bit }, |
89 { "1aBc", k16Bit }, | 89 { "1aBc", k16Bit }, |
90 { "00001abc", k32Bit }, | 90 { "00001abc", k32Bit }, |
91 { "00001ABC", k32Bit }, | 91 { "00001ABC", k32Bit }, |
92 { "00001aBc", k32Bit }, | 92 { "00001aBc", k32Bit }, |
93 { "00001abc-0000-1000-8000-00805f9b34fb", k128Bit }, | 93 { "00001abc-0000-1000-8000-00805f9b34fb", k128Bit }, |
94 { "00001ABC-0000-1000-8000-00805F9B34FB", k128Bit }, | 94 { "00001ABC-0000-1000-8000-00805F9B34FB", k128Bit }, |
95 { "00001aBc-0000-1000-8000-00805F9b34fB", k128Bit }, | 95 { "00001aBc-0000-1000-8000-00805F9b34fB", k128Bit }, |
96 }; | 96 }; |
97 | 97 |
98 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { | 98 for (size_t i = 0; i < arraysize(test_cases); ++i) { |
99 SCOPED_TRACE("Input UUID: " + test_cases[i].input_uuid); | 99 SCOPED_TRACE("Input UUID: " + test_cases[i].input_uuid); |
100 BluetoothUUID uuid(test_cases[i].input_uuid); | 100 BluetoothUUID uuid(test_cases[i].input_uuid); |
101 EXPECT_TRUE(uuid.IsValid()); | 101 EXPECT_TRUE(uuid.IsValid()); |
102 EXPECT_EQ(test_cases[i].expected_value, uuid.value()); | 102 EXPECT_EQ(test_cases[i].expected_value, uuid.value()); |
103 EXPECT_EQ(k128Bit, uuid.canonical_value()); | 103 EXPECT_EQ(k128Bit, uuid.canonical_value()); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 } // namespace device | 107 } // namespace device |
OLD | NEW |