Skip to content

Commit 388968f

Browse files
bridadan0xc0170
authored andcommitted
Simplifying assert statements
1 parent 6e76fce commit 388968f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ void test_tcp_echo() {
7777

7878
result = !memcmp(tx_buffer, rx_buffer, sizeof(tx_buffer));
7979
TEST_ASSERT_EQUAL(ret, sizeof(rx_buffer));
80-
TEST_ASSERT_EQUAL(true, result);
80+
TEST_ASSERT(result);
8181
}
8282

8383
sock.close();
8484
eth.disconnect();
85-
TEST_ASSERT_EQUAL(true, result);
85+
TEST_ASSERT(result);
8686
}
8787

8888

features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo_parallel/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Echo {
8080
const int ret = sock.recv(rx_buffer, sizeof(rx_buffer));
8181
bool result = !memcmp(tx_buffer, rx_buffer, sizeof(tx_buffer));
8282
TEST_ASSERT_EQUAL(ret, sizeof(rx_buffer));
83-
TEST_ASSERT_EQUAL(true, result);
83+
TEST_ASSERT(result);
8484

8585
err = sock.close();
8686
TEST_ASSERT_EQUAL(0, err);

features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_hello_world/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ void test_tcp_hello_world() {
6969
// Find "Hello World!" string in reply
7070
bool found_hello = find_substring(buffer, buffer + ret, HTTP_HELLO_STR, HTTP_HELLO_STR + strlen(HTTP_HELLO_STR));
7171

72-
TEST_ASSERT_TRUE(found_200_ok);
73-
TEST_ASSERT_TRUE(found_hello);
72+
TEST_ASSERT(found_200_ok);
73+
TEST_ASSERT(found_hello);
7474

7575
if (found_200_ok && found_hello) result = true;
7676

@@ -85,7 +85,7 @@ void test_tcp_hello_world() {
8585
}
8686

8787
eth.disconnect();
88-
TEST_ASSERT_EQUAL(true, result);
88+
TEST_ASSERT(result);
8989
}
9090

9191

features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_dtls_handshake/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void test_udp_dtls_handshake() {
129129
}
130130

131131
eth.disconnect();
132-
TEST_ASSERT_EQUAL(true, result);
132+
TEST_ASSERT(result);
133133
}
134134

135135

features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void test_udp_echo_parallel() {
195195
}
196196

197197
net.disconnect();
198-
TEST_ASSERT_EQUAL(true, result);
198+
TEST_ASSERT(result);
199199
}
200200
}
201201

0 commit comments

Comments
 (0)