Simplifying assert statements

pull/4369/head
Brian Daniels 2017-05-22 18:43:14 -05:00 committed by Martin Kojtal
parent 6e76fce4fc
commit 388968f76b
5 changed files with 8 additions and 8 deletions

View File

@ -77,12 +77,12 @@ void test_tcp_echo() {
result = !memcmp(tx_buffer, rx_buffer, sizeof(tx_buffer));
TEST_ASSERT_EQUAL(ret, sizeof(rx_buffer));
TEST_ASSERT_EQUAL(true, result);
TEST_ASSERT(result);
}
sock.close();
eth.disconnect();
TEST_ASSERT_EQUAL(true, result);
TEST_ASSERT(result);
}

View File

@ -80,7 +80,7 @@ public:
const int ret = sock.recv(rx_buffer, sizeof(rx_buffer));
bool result = !memcmp(tx_buffer, rx_buffer, sizeof(tx_buffer));
TEST_ASSERT_EQUAL(ret, sizeof(rx_buffer));
TEST_ASSERT_EQUAL(true, result);
TEST_ASSERT(result);
err = sock.close();
TEST_ASSERT_EQUAL(0, err);

View File

@ -69,8 +69,8 @@ void test_tcp_hello_world() {
// Find "Hello World!" string in reply
bool found_hello = find_substring(buffer, buffer + ret, HTTP_HELLO_STR, HTTP_HELLO_STR + strlen(HTTP_HELLO_STR));
TEST_ASSERT_TRUE(found_200_ok);
TEST_ASSERT_TRUE(found_hello);
TEST_ASSERT(found_200_ok);
TEST_ASSERT(found_hello);
if (found_200_ok && found_hello) result = true;
@ -85,7 +85,7 @@ void test_tcp_hello_world() {
}
eth.disconnect();
TEST_ASSERT_EQUAL(true, result);
TEST_ASSERT(result);
}

View File

@ -129,7 +129,7 @@ void test_udp_dtls_handshake() {
}
eth.disconnect();
TEST_ASSERT_EQUAL(true, result);
TEST_ASSERT(result);
}

View File

@ -195,7 +195,7 @@ void test_udp_echo_parallel() {
}
net.disconnect();
TEST_ASSERT_EQUAL(true, result);
TEST_ASSERT(result);
}
}