| Index: device/usb/usb_device_filter_unittest.cc
|
| diff --git a/device/usb/usb_device_filter_unittest.cc b/device/usb/usb_device_filter_unittest.cc
|
| index a12d54758cd8599965e6699e78de8fc7b8a58bef..0336e16dafcaf6e0a69a6c4de5664c8f4094428a 100644
|
| --- a/device/usb/usb_device_filter_unittest.cc
|
| +++ b/device/usb/usb_device_filter_unittest.cc
|
| @@ -37,69 +37,69 @@ TEST_F(UsbFilterTest, MatchAny) {
|
|
|
| TEST_F(UsbFilterTest, MatchVendorId) {
|
| UsbDeviceFilter filter;
|
| - filter.SetVendorId(0x18d1);
|
| + filter.vendor_id = 0x18d1;
|
| ASSERT_TRUE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchVendorIdNegative) {
|
| UsbDeviceFilter filter;
|
| - filter.SetVendorId(0x1d6b);
|
| + filter.vendor_id = 0x1d6b;
|
| ASSERT_FALSE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchProductId) {
|
| UsbDeviceFilter filter;
|
| - filter.SetVendorId(0x18d1);
|
| - filter.SetProductId(0x4ee2);
|
| + filter.vendor_id = 0x18d1;
|
| + filter.product_id = 0x4ee2;
|
| ASSERT_TRUE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchProductIdNegative) {
|
| UsbDeviceFilter filter;
|
| - filter.SetVendorId(0x18d1);
|
| - filter.SetProductId(0x4ee1);
|
| + filter.vendor_id = 0x18d1;
|
| + filter.product_id = 0x4ee1;
|
| ASSERT_FALSE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchInterfaceClass) {
|
| UsbDeviceFilter filter;
|
| - filter.SetInterfaceClass(0xff);
|
| + filter.interface_class = 0xff;
|
| ASSERT_TRUE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchInterfaceClassNegative) {
|
| UsbDeviceFilter filter;
|
| - filter.SetInterfaceClass(0xe0);
|
| + filter.interface_class = 0xe0;
|
| ASSERT_FALSE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchInterfaceSubclass) {
|
| UsbDeviceFilter filter;
|
| - filter.SetInterfaceClass(0xff);
|
| - filter.SetInterfaceSubclass(0x42);
|
| + filter.interface_class = 0xff;
|
| + filter.interface_subclass = 0x42;
|
| ASSERT_TRUE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchInterfaceSubclassNegative) {
|
| UsbDeviceFilter filter;
|
| - filter.SetInterfaceClass(0xff);
|
| - filter.SetInterfaceSubclass(0x01);
|
| + filter.interface_class = 0xff;
|
| + filter.interface_subclass = 0x01;
|
| ASSERT_FALSE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchInterfaceProtocol) {
|
| UsbDeviceFilter filter;
|
| - filter.SetInterfaceClass(0xff);
|
| - filter.SetInterfaceSubclass(0x42);
|
| - filter.SetInterfaceProtocol(0x01);
|
| + filter.interface_class = 0xff;
|
| + filter.interface_subclass = 0x42;
|
| + filter.interface_protocol = 0x01;
|
| ASSERT_TRUE(filter.Matches(android_phone_));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchInterfaceProtocolNegative) {
|
| UsbDeviceFilter filter;
|
| - filter.SetInterfaceClass(0xff);
|
| - filter.SetInterfaceSubclass(0x42);
|
| - filter.SetInterfaceProtocol(0x02);
|
| + filter.interface_class = 0xff;
|
| + filter.interface_subclass = 0x42;
|
| + filter.interface_protocol = 0x02;
|
| ASSERT_FALSE(filter.Matches(android_phone_));
|
| }
|
|
|
| @@ -110,13 +110,13 @@ TEST_F(UsbFilterTest, MatchAnyEmptyList) {
|
|
|
| TEST_F(UsbFilterTest, MatchesAnyVendorId) {
|
| std::vector<UsbDeviceFilter> filters(1);
|
| - filters.back().SetVendorId(0x18d1);
|
| + filters.back().vendor_id = 0x18d1;
|
| ASSERT_TRUE(UsbDeviceFilter::MatchesAny(android_phone_, filters));
|
| }
|
|
|
| TEST_F(UsbFilterTest, MatchesAnyVendorIdNegative) {
|
| std::vector<UsbDeviceFilter> filters(1);
|
| - filters.back().SetVendorId(0x1d6b);
|
| + filters.back().vendor_id = 0x1d6b;
|
| ASSERT_FALSE(UsbDeviceFilter::MatchesAny(android_phone_, filters));
|
| }
|
|
|
|
|