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 #include <stdint.h> |
| 7 |
5 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
6 #include "device/bluetooth/bluetooth_low_energy_win.h" | 9 #include "device/bluetooth/bluetooth_low_energy_win.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
8 | 11 |
9 namespace { | 12 namespace { |
10 | 13 |
11 const char kValidDeviceInstanceId[] = | 14 const char kValidDeviceInstanceId[] = |
12 "BTHLE\\DEV_BC6A29AB5FB0\\8&31038925&0&BC6A29AB5FB0"; | 15 "BTHLE\\DEV_BC6A29AB5FB0\\8&31038925&0&BC6A29AB5FB0"; |
13 | 16 |
14 const char kInvalidDeviceInstanceId[] = | 17 const char kInvalidDeviceInstanceId[] = |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 size_t buffer_size = sizeof(uint32_t); | 79 size_t buffer_size = sizeof(uint32_t); |
77 scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]); | 80 scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]); |
78 memcpy(buffer.get(), &test_value, buffer_size); | 81 memcpy(buffer.get(), &test_value, buffer_size); |
79 scoped_ptr<device::win::DevicePropertyValue> value( | 82 scoped_ptr<device::win::DevicePropertyValue> value( |
80 new device::win::DevicePropertyValue( | 83 new device::win::DevicePropertyValue( |
81 DEVPROP_TYPE_UINT32, buffer.Pass(), buffer_size)); | 84 DEVPROP_TYPE_UINT32, buffer.Pass(), buffer_size)); |
82 EXPECT_EQ(test_value, value->AsUint32()); | 85 EXPECT_EQ(test_value, value->AsUint32()); |
83 } | 86 } |
84 | 87 |
85 } // namespace device | 88 } // namespace device |
OLD | NEW |