blob: 7a569cf69394bb0dae6ca466748a33201ad878c8 [file] [log] [blame]
Brian Silverman395d6252013-09-13 20:58:14 -07001// 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
9namespace glibusb {
10namespace testing {
11
12// Tests that DeviceLocationAndId gets streamed correctly.
13TEST(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.
26TEST(LibusbTest, SetupTeardown) {
27 Libusb libusb;
28}
29
30// Tests SetDebug
31TEST(LibusbTest, SetDebug) {
32 Libusb libusb;
33 libusb.SetDebug(1);
34}
35
36} // namespace testing
37} // namespace glibusb