Commit c6fb742e2972d5c4d99f4ba2053a09424e70ca91
Committed by
Jan
1 parent
824879bc
Add test for invalid description.
Showing
1 changed file
with
7 additions
and
0 deletions
hueplusplus/test/test_Hue.cpp
| @@ -52,6 +52,13 @@ TEST_F(HueFinderTest, FindBridges) { | @@ -52,6 +52,13 @@ TEST_F(HueFinderTest, FindBridges) { | ||
| 52 | << "HueIdentification ip does not match"; | 52 | << "HueIdentification ip does not match"; |
| 53 | EXPECT_EQ(bridges[0].mac, bridge_to_comp.mac) | 53 | EXPECT_EQ(bridges[0].mac, bridge_to_comp.mac) |
| 54 | << "HueIdentification mac does not match"; | 54 | << "HueIdentification mac does not match"; |
| 55 | + | ||
| 56 | + // Test invalid description | ||
| 57 | + EXPECT_CALL(*handler, GETString("/description.xml", "application/xml", "", getBridgeIp(), 80)) | ||
| 58 | + .Times(1) | ||
| 59 | + .WillOnce(::testing::Return("invalid stuff")); | ||
| 60 | + bridges = finder.FindBridges(); | ||
| 61 | + EXPECT_TRUE(bridges.empty()); | ||
| 55 | } | 62 | } |
| 56 | 63 | ||
| 57 | TEST_F(HueFinderTest, GetBridge) { | 64 | TEST_F(HueFinderTest, GetBridge) { |