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 <stddef.h> |
| 6 |
5 #include "base/macros.h" | 7 #include "base/macros.h" |
6 #include "device/bluetooth/bluetooth_uuid.h" | 8 #include "device/bluetooth/bluetooth_uuid.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
8 | 10 |
9 namespace device { | 11 namespace device { |
10 | 12 |
11 TEST(BluetoothUUIDTest, BluetoothUUID) { | 13 TEST(BluetoothUUIDTest, BluetoothUUID) { |
12 const char kValid128Bit0[] = "12345678-1234-5678-9abc-def123456789"; | 14 const char kValid128Bit0[] = "12345678-1234-5678-9abc-def123456789"; |
13 const char kValid128Bit1[] = "00001101-0000-1000-8000-00805f9b34fb"; | 15 const char kValid128Bit1[] = "00001101-0000-1000-8000-00805f9b34fb"; |
14 const char kInvalid36Char0[] = "1234567-1234-5678-9abc-def123456789"; | 16 const char kInvalid36Char0[] = "1234567-1234-5678-9abc-def123456789"; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 for (size_t i = 0; i < arraysize(test_cases); ++i) { | 100 for (size_t i = 0; i < arraysize(test_cases); ++i) { |
99 SCOPED_TRACE("Input UUID: " + test_cases[i].input_uuid); | 101 SCOPED_TRACE("Input UUID: " + test_cases[i].input_uuid); |
100 BluetoothUUID uuid(test_cases[i].input_uuid); | 102 BluetoothUUID uuid(test_cases[i].input_uuid); |
101 EXPECT_TRUE(uuid.IsValid()); | 103 EXPECT_TRUE(uuid.IsValid()); |
102 EXPECT_EQ(test_cases[i].expected_value, uuid.value()); | 104 EXPECT_EQ(test_cases[i].expected_value, uuid.value()); |
103 EXPECT_EQ(k128Bit, uuid.canonical_value()); | 105 EXPECT_EQ(k128Bit, uuid.canonical_value()); |
104 } | 106 } |
105 } | 107 } |
106 | 108 |
107 } // namespace device | 109 } // namespace device |
OLD | NEW |