@@ -4,6 +4,8 @@ const char * host = "localhost";
44
55namespace ClientTest
66{
7+ const char * localhost = " localhost" ;
8+
79 class MyService
810 {
911 public:
@@ -32,7 +34,7 @@ namespace ClientTest
3234 Client* client = ArduinoFakeMock (Client);
3335
3436 TEST_ASSERT_EQUAL (0 , client->connected ());
35- TEST_ASSERT_EQUAL (1 , client->connect (host , 8080 ));
37+ TEST_ASSERT_EQUAL (1 , client->connect (localhost , 8080 ));
3638 TEST_ASSERT_EQUAL (1 , client->connected ());
3739 TEST_ASSERT_EQUAL (2 , client->peek ());
3840
@@ -43,7 +45,7 @@ namespace ClientTest
4345 Verify (Method (ArduinoFake (Client), peek)).Once ();
4446 Verify (Method (ArduinoFake (Client), flush)).Once ();
4547 Verify (Method (ArduinoFake (Client), connected)).Exactly (2_Times);
46- Verify (OverloadedMethod (ArduinoFake (Client), connect, int (const char *, uint16_t )).Using (host , 8080 )).Once ();
48+ Verify (OverloadedMethod (ArduinoFake (Client), connect, int (const char *, uint16_t )).Using (localhost , 8080 )).Once ();
4749 }
4850
4951 void test_connect (void )
@@ -56,14 +58,14 @@ namespace ClientTest
5658
5759 Client* client = ArduinoFakeMock (Client);
5860
59- TEST_ASSERT_EQUAL (1 , client->connect (host , 8080 ));
60- TEST_ASSERT_EQUAL (0 , client->connect (host , 80 ));
61+ TEST_ASSERT_EQUAL (1 , client->connect (localhost , 8080 ));
62+ TEST_ASSERT_EQUAL (0 , client->connect (localhost , 80 ));
6163
6264 TEST_ASSERT_EQUAL (0 , client->connect (ipAddress1, 8080 ));
6365 TEST_ASSERT_EQUAL (1 , client->connect (ipAddress2, 8080 ));
6466
65- Verify (OverloadedMethod (ArduinoFake (Client), connect, int (const char *, uint16_t )).Using (host , 8080 )).Once ();
66- Verify (OverloadedMethod (ArduinoFake (Client), connect, int (const char *, uint16_t )).Using (host , 80 )).Once ();
67+ Verify (OverloadedMethod (ArduinoFake (Client), connect, int (const char *, uint16_t )).Using (localhost , 8080 )).Once ();
68+ Verify (OverloadedMethod (ArduinoFake (Client), connect, int (const char *, uint16_t )).Using (localhost , 80 )).Once ();
6769
6870 Verify (OverloadedMethod (ArduinoFake (Client), connect, int (IPAddress, uint16_t )).Using (ipAddress1, 8080 )).Once ();
6971 Verify (OverloadedMethod (ArduinoFake (Client), connect, int (IPAddress, uint16_t )).Using (ipAddress2, 8080 )).Once ();
0 commit comments