• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenLightingProject / ola / 5642

pending completion
5642

push

travis-ci-com

web-flow
Use ccache and cache the build

22522 of 46668 relevant lines covered (48.26%)

51.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/libs/usb/Types.cpp
1
/*
2
 * This program is free software; you can redistribute it and/or modify
3
 * it under the terms of the GNU General Public License as published by
4
 * the Free Software Foundation; either version 2 of the License, or
5
 * (at your option) any later version.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU Library General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15
 *
16
 * Types.cpp
17
 * Types used with the USB subsystem.
18
 * Copyright (C) 2015 Simon Newton
19
 */
20

21
#include "libs/usb/Types.h"
22
#include <ostream>
23

24
#include "ola/strings/Format.h"
25

26
namespace ola {
27
namespace usb {
28

29
using std::ostream;
30

31
USBDeviceID::USBDeviceID(uint8_t bus_number, uint8_t device_address)
4✔
32
    : bus_number(bus_number),
33
      device_address(device_address) {
4✔
34
}
4✔
35

36
bool USBDeviceID::operator<(const USBDeviceID &id) const {
4✔
37
  if (bus_number < id.bus_number) {
4✔
38
    return true;
39
  } else if (bus_number == id.bus_number) {
×
40
    return device_address < id.device_address;
×
41
  }
42
  return false;
43
}
44

45
ostream& operator<<(ostream& os, const USBDeviceID &id) {
2✔
46
  return os << ola::strings::IntToString(id.bus_number) << ":"
2✔
47
            << ola::strings::IntToString(id.device_address);
4✔
48
}
49
}  // namespace usb
50
}  // namespace ola
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc