Skip to content

Commit 74884bb

Browse files
committed
Fixed more greentea tests
1 parent 5016fa1 commit 74884bb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

TESTS/mbed_drivers/reset_reason/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static cmd_status_t handle_command(const char *key, const char *value)
7575
int raw_reason_hex_str_len = snprintf(raw_reason_hex_str,
7676
sizeof raw_reason_hex_str, "%08lx", raw_reason);
7777

78-
if (raw_reason_hex_str_len != (sizeof raw_reason_hex_str) - 1) {
78+
if (raw_reason_hex_str_len < 0) {
7979
TEST_ASSERT_MESSAGE(0, "Failed to compose raw reset reason hex string.");
8080
return CMD_STATUS_ERROR;
8181
}
@@ -134,7 +134,7 @@ void test_reset_reason()
134134
hal_reset_reason_get_capabilities(&rrcap);
135135
char msg_value[11];
136136
int str_len = snprintf(msg_value, sizeof msg_value, "%08lx,%01x", rrcap.reasons, MSG_VALUE_WATCHDOG_STATUS);
137-
if (str_len != (sizeof msg_value) - 1) {
137+
if (str_len < 0) {
138138
printf("Failed to compose a value string to be sent to host.");
139139
GREENTEA_TESTSUITE_RESULT(0);
140140
return;

TESTS/mbed_hal/reset_reason/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static cmd_status_t handle_command(const char *key, const char *value)
7575
int raw_reason_hex_str_len = snprintf(raw_reason_hex_str,
7676
sizeof raw_reason_hex_str, "%08lx", raw_reason);
7777

78-
if (raw_reason_hex_str_len != (sizeof raw_reason_hex_str) - 1) {
78+
if (raw_reason_hex_str_len < 0) {
7979
TEST_ASSERT_MESSAGE(0, "Failed to compose raw reset reason hex string.");
8080
return CMD_STATUS_ERROR;
8181
}
@@ -129,7 +129,7 @@ void test_reset_reason()
129129
hal_reset_reason_get_capabilities(&rrcap);
130130
char msg_value[11];
131131
int str_len = snprintf(msg_value, sizeof msg_value, "%08lx,%01x", rrcap.reasons, MSG_VALUE_WATCHDOG_STATUS);
132-
if (str_len != (sizeof msg_value) - 1) {
132+
if (str_len < 0) {
133133
printf("Failed to compose a value string to be sent to host.");
134134
GREENTEA_TESTSUITE_RESULT(0);
135135
return;

TESTS/mbed_timing_fpga_ci_test_shield/watchdog/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ bool send_reset_notification(testcase_data *tcdata, uint32_t delay_ms)
119119
{
120120
char msg_value[12];
121121
int str_len = snprintf(msg_value, sizeof msg_value, "%02x,%08lx", tcdata->start_index + tcdata->index, delay_ms);
122-
if (str_len != (sizeof msg_value) - 1) {
122+
if (str_len < 0) {
123123
utest_printf("Failed to compose a value string to be sent to host.");
124124
return false;
125125
}

0 commit comments

Comments
 (0)