Commit ba0070306e21eb5338732c2dddaa3b8b003cb325

Authored by Nodeduino
Committed by Moritz Wirger
1 parent ced60b11

Make Hue test getLight more stable

Showing 1 changed file with 5 additions and 5 deletions
hueplusplus/test/test_Hue.cpp
... ... @@ -208,7 +208,7 @@ TEST(Hue, getLight)
208 208 .WillOnce(::testing::Return(hue_bridge_state));
209 209  
210 210 EXPECT_CALL(*handler, GETJson("/api/" + bridge_username + "/lights/1", empty_json_obj, bridge_ip, 80))
211   - .Times(3)
  211 + .Times(::testing::AtLeast(1))
212 212 .WillRepeatedly(::testing::Return(hue_bridge_state["lights"]["1"]));
213 213  
214 214 // Test when correct data is sent
... ... @@ -230,7 +230,7 @@ TEST(Hue, getLight)
230 230 .WillOnce(::testing::Return(hue_bridge_state));
231 231  
232 232 EXPECT_CALL(*handler, GETJson("/api/" + bridge_username + "/lights/1", empty_json_obj, bridge_ip, 80))
233   - .Times(2)
  233 + .Times(::testing::AtLeast(1))
234 234 .WillRepeatedly(::testing::Return(hue_bridge_state["lights"]["1"]));
235 235 test_bridge = Hue(bridge_ip, bridge_username, handler);
236 236  
... ... @@ -246,7 +246,7 @@ TEST(Hue, getLight)
246 246 .WillOnce(::testing::Return(hue_bridge_state));
247 247  
248 248 EXPECT_CALL(*handler, GETJson("/api/" + bridge_username + "/lights/1", empty_json_obj, bridge_ip, 80))
249   - .Times(2)
  249 + .Times(::testing::AtLeast(1))
250 250 .WillRepeatedly(::testing::Return(hue_bridge_state["lights"]["1"]));
251 251 test_bridge = Hue(bridge_ip, bridge_username, handler);
252 252  
... ... @@ -262,7 +262,7 @@ TEST(Hue, getLight)
262 262 .WillOnce(::testing::Return(hue_bridge_state));
263 263  
264 264 EXPECT_CALL(*handler, GETJson("/api/" + bridge_username + "/lights/1", empty_json_obj, bridge_ip, 80))
265   - .Times(2)
  265 + .Times(::testing::AtLeast(1))
266 266 .WillRepeatedly(::testing::Return(hue_bridge_state["lights"]["1"]));
267 267 test_bridge = Hue(bridge_ip, bridge_username, handler);
268 268  
... ... @@ -278,7 +278,7 @@ TEST(Hue, getLight)
278 278 .WillOnce(::testing::Return(hue_bridge_state));
279 279  
280 280 EXPECT_CALL(*handler, GETJson("/api/" + bridge_username + "/lights/1", empty_json_obj, bridge_ip, 80))
281   - .Times(2)
  281 + .Times(::testing::AtLeast(1))
282 282 .WillRepeatedly(::testing::Return(hue_bridge_state["lights"]["1"]));
283 283 test_bridge = Hue(bridge_ip, bridge_username, handler);
284 284  
... ...