diff options
Diffstat (limited to 'auto_tests')
-rw-r--r-- | auto_tests/messenger_test.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c index 374bc5a6..67156db4 100644 --- a/auto_tests/messenger_test.c +++ b/auto_tests/messenger_test.c | |||
@@ -87,13 +87,13 @@ START_TEST(test_m_set_userstatus) | |||
87 | uint16_t good_length = strlen(status); | 87 | uint16_t good_length = strlen(status); |
88 | uint16_t bad_length = REALLY_BIG_NUMBER; | 88 | uint16_t bad_length = REALLY_BIG_NUMBER; |
89 | 89 | ||
90 | if (m_set_statusmessage(m, (uint8_t *)status, bad_length) != -1) | 90 | ck_assert_msg((m_set_statusmessage(m, (uint8_t *)status, bad_length) == -1), |
91 | ck_abort_msg("m_set_userstatus did NOT catch the following length: %d\n", | 91 | "m_set_userstatus did NOT catch the following length: %d\n", |
92 | REALLY_BIG_NUMBER); | 92 | REALLY_BIG_NUMBER); |
93 | 93 | ||
94 | if ((m_set_statusmessage(m, (uint8_t *)status, good_length)) != 0) | 94 | ck_assert_msg((m_set_statusmessage(m, (uint8_t *)status, good_length) == 0), |
95 | ck_abort_msg("m_set_userstatus did NOT return 0 on the following length: %d\n" | 95 | "m_set_userstatus did NOT return 0 on the following length: %d\n" |
96 | "MAX_STATUSMESSAGE_LENGTH: %d\n", good_length, MAX_STATUSMESSAGE_LENGTH); | 96 | "MAX_STATUSMESSAGE_LENGTH: %d\n", good_length, MAX_STATUSMESSAGE_LENGTH); |
97 | } | 97 | } |
98 | END_TEST | 98 | END_TEST |
99 | 99 | ||
@@ -156,12 +156,11 @@ START_TEST(test_setname) | |||
156 | int good_length = strlen(good_name); | 156 | int good_length = strlen(good_name); |
157 | int bad_length = REALLY_BIG_NUMBER; | 157 | int bad_length = REALLY_BIG_NUMBER; |
158 | 158 | ||
159 | if (setname(m, (uint8_t *)good_name, bad_length) != -1) | 159 | ck_assert_msg((setname(m, (uint8_t *)good_name, bad_length) == -1), |
160 | ck_abort_msg("setname() did NOT error on %d as a length argument!\n", | 160 | "setname() did NOT error on %d as a length argument!\n", bad_length); |
161 | bad_length); | ||
162 | 161 | ||
163 | if (setname(m, (uint8_t *)good_name, good_length) != 0) | 162 | ck_assert_msg((setname(m, (uint8_t *)good_name, good_length) == 0), |
164 | ck_abort_msg("setname() did NOT return 0 on good arguments!\n"); | 163 | "setname() did NOT return 0 on good arguments!\n"); |
165 | } | 164 | } |
166 | END_TEST | 165 | END_TEST |
167 | 166 | ||