MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / TEST

Function TEST

dependencies/hueplusplus-1.0.0/test/test_NewDeviceList.cpp:30–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using namespace testing;
29
30TEST(NewDeviceList, Constructor)
31{
32 {
33 NewDeviceList list("none", {});
34 EXPECT_TRUE(list.getNewDevices().empty());
35 EXPECT_FALSE(list.hasLastScanTime());
36 EXPECT_FALSE(list.isScanActive());
37 EXPECT_THROW(list.getLastScanTime(), HueException);
38 }
39 {
40 const std::map<int, std::string> devices = {{1, "a"}, {2, "b"}, {3, "c"}};
41 NewDeviceList list("active", devices);
42 EXPECT_FALSE(list.hasLastScanTime());
43 EXPECT_TRUE(list.isScanActive());
44 EXPECT_EQ(devices, list.getNewDevices());
45 EXPECT_THROW(list.getLastScanTime(), HueException);
46 }
47 {
48 const std::string timestamp = "2020-03-01T00:10:00";
49 NewDeviceList list(timestamp, {});
50 EXPECT_TRUE(list.hasLastScanTime());
51 EXPECT_FALSE(list.isScanActive());
52 EXPECT_EQ(time::AbsoluteTime::parseUTC(timestamp).getBaseTime(), list.getLastScanTime().getBaseTime());
53 }
54}
55
56TEST(NewDeviceList, parse)
57{

Callers

nothing calls this directly

Calls 7

getNewDevicesMethod · 0.80
hasLastScanTimeMethod · 0.80
isScanActiveMethod · 0.80
getLastScanTimeMethod · 0.80
getBaseTimeMethod · 0.80
parseFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected