File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,13 @@ void prep_buffer(char *tx_buffer, size_t tx_size) {
30
30
31
31
int main () {
32
32
GREENTEA_SETUP (60 , " tcp_echo" );
33
-
34
33
EthernetInterface eth;
35
- eth.connect ();
34
+ int err = eth.connect ();
35
+
36
+ if (err) {
37
+ printf (" MBED: failed to connect with an error of %d\r\n " , err);
38
+ GREENTEA_TESTSUITE_RESULT (false );
39
+ }
36
40
37
41
printf (" MBED: TCPClient IP address is '%s'\n " , eth.get_ip_address ());
38
42
printf (" MBED: TCPClient waiting for server IP and port...\n " );
@@ -64,12 +68,12 @@ int main() {
64
68
65
69
prep_buffer (tx_buffer, sizeof (tx_buffer));
66
70
sock.send (tx_buffer, sizeof (tx_buffer));
67
-
71
+ printf ( " MBED: Finished sending \r\n " );
68
72
// Server will respond with HTTP GET's success code
69
73
const int ret = sock.recv (rx_buffer, sizeof (rx_buffer));
70
-
74
+ printf (" MBED: Finished receiving\r\n " );
75
+
71
76
result = !memcmp (tx_buffer, rx_buffer, sizeof (tx_buffer));
72
-
73
77
TEST_ASSERT_EQUAL (ret, sizeof (rx_buffer));
74
78
TEST_ASSERT_EQUAL (true , result);
75
79
}
You can’t perform that action at this time.
0 commit comments