Brian Silverman | 395d625 | 2013-09-13 20:58:14 -0700 | [diff] [blame^] | 1 | // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 | // Author: charliehotel@google.com (Christopher Hoover) |
| 3 | |
| 4 | #include "../glibusb.h" |
| 5 | |
| 6 | #include <sstream> |
| 7 | #include <gtest/gtest.h> |
| 8 | |
| 9 | namespace glibusb { |
| 10 | namespace testing { |
| 11 | |
| 12 | // Tests that DeviceLocationAndId gets streamed correctly. |
| 13 | TEST(LibusbTest, LogsLocationAndID) { |
| 14 | DeviceLocationAndId location_and_id; |
| 15 | location_and_id.location.bus_number = 10; |
| 16 | location_and_id.location.device_address = 20; |
| 17 | location_and_id.id.vendor_id = 0x30; |
| 18 | location_and_id.id.product_id = 0x40; |
| 19 | |
| 20 | std::stringstream out; |
| 21 | out << location_and_id; |
| 22 | EXPECT_EQ("010:020 0030:0040", out.str()); |
| 23 | } |
| 24 | |
| 25 | // Tests setup and teardown. |
| 26 | TEST(LibusbTest, SetupTeardown) { |
| 27 | Libusb libusb; |
| 28 | } |
| 29 | |
| 30 | // Tests SetDebug |
| 31 | TEST(LibusbTest, SetDebug) { |
| 32 | Libusb libusb; |
| 33 | libusb.SetDebug(1); |
| 34 | } |
| 35 | |
| 36 | } // namespace testing |
| 37 | } // namespace glibusb |