blob: 9f159701401b11f6cf5c4fac7a95948f313973b9 [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)
Brian Silverman7221e812013-09-13 22:32:12 -07003//
4// Modified by FRC Team 971.
Brian Silverman395d6252013-09-13 20:58:14 -07005
Brian Silverman7221e812013-09-13 22:32:12 -07006#include "glibusb.h"
Brian Silverman395d6252013-09-13 20:58:14 -07007
8#include <sstream>
9#include <gtest/gtest.h>
10
11namespace glibusb {
12namespace testing {
13
14// Tests that DeviceLocationAndId gets streamed correctly.
15TEST(LibusbTest, LogsLocationAndID) {
16 DeviceLocationAndId location_and_id;
17 location_and_id.location.bus_number = 10;
18 location_and_id.location.device_address = 20;
19 location_and_id.id.vendor_id = 0x30;
20 location_and_id.id.product_id = 0x40;
21
22 std::stringstream out;
23 out << location_and_id;
24 EXPECT_EQ("010:020 0030:0040", out.str());
25}
26
27// Tests setup and teardown.
28TEST(LibusbTest, SetupTeardown) {
29 Libusb libusb;
30}
31
32// Tests SetDebug
33TEST(LibusbTest, SetDebug) {
34 Libusb libusb;
35 libusb.SetDebug(1);
36}
37
38} // namespace testing
39} // namespace glibusb