diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-08-31 19:12:19 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-08-31 20:04:16 +0100 |
commit | 633da98ae69866efb195e00d9a3a22ace6bada66 (patch) | |
tree | 875535f3d2257c4ea5bb97a553b2f1beab4a1590 /auto_tests/messenger_test.c | |
parent | 6356eb4e4fe407fa7870f2a685d0d08b5c2ec5bb (diff) |
Add braces to all if statements.
Diffstat (limited to 'auto_tests/messenger_test.c')
-rw-r--r-- | auto_tests/messenger_test.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c index 9d72ca46..b8559b17 100644 --- a/auto_tests/messenger_test.c +++ b/auto_tests/messenger_test.c | |||
@@ -237,9 +237,9 @@ START_TEST(test_dht_state_saveloadsave) | |||
237 | 237 | ||
238 | int res = DHT_load(m->dht, buffer + extra, size); | 238 | int res = DHT_load(m->dht, buffer + extra, size); |
239 | 239 | ||
240 | if (res == -1) | 240 | if (res == -1) { |
241 | ck_assert_msg(res == 0, "Failed to load back stored buffer: res == -1"); | 241 | ck_assert_msg(res == 0, "Failed to load back stored buffer: res == -1"); |
242 | else { | 242 | } else { |
243 | char msg[128]; | 243 | char msg[128]; |
244 | size_t offset = res >> 4; | 244 | size_t offset = res >> 4; |
245 | uint8_t *ptr = buffer + extra + offset; | 245 | uint8_t *ptr = buffer + extra + offset; |
@@ -279,9 +279,9 @@ START_TEST(test_messenger_state_saveloadsave) | |||
279 | 279 | ||
280 | int res = messenger_load(m, buffer + extra, size); | 280 | int res = messenger_load(m, buffer + extra, size); |
281 | 281 | ||
282 | if (res == -1) | 282 | if (res == -1) { |
283 | ck_assert_msg(res == 0, "Failed to load back stored buffer: res == -1"); | 283 | ck_assert_msg(res == 0, "Failed to load back stored buffer: res == -1"); |
284 | else { | 284 | } else { |
285 | char msg[128]; | 285 | char msg[128]; |
286 | size_t offset = res >> 4; | 286 | size_t offset = res >> 4; |
287 | uint8_t *ptr = buffer + extra + offset; | 287 | uint8_t *ptr = buffer + extra + offset; |
@@ -340,15 +340,17 @@ int main(int argc, char *argv[]) | |||
340 | m = new_messenger(NULL, &options, 0); | 340 | m = new_messenger(NULL, &options, 0); |
341 | 341 | ||
342 | /* setup a default friend and friendnum */ | 342 | /* setup a default friend and friendnum */ |
343 | if (m_addfriend_norequest(m, (uint8_t *)friend_id) < 0) | 343 | if (m_addfriend_norequest(m, (uint8_t *)friend_id) < 0) { |
344 | fputs("m_addfriend_norequest() failed on a valid ID!\n" | 344 | fputs("m_addfriend_norequest() failed on a valid ID!\n" |
345 | "this was CRITICAL to the test, and the build WILL fail.\n" | 345 | "this was CRITICAL to the test, and the build WILL fail.\n" |
346 | "the tests will continue now...\n\n", stderr); | 346 | "the tests will continue now...\n\n", stderr); |
347 | } | ||
347 | 348 | ||
348 | if ((friend_id_num = getfriend_id(m, (uint8_t *)friend_id)) < 0) | 349 | if ((friend_id_num = getfriend_id(m, (uint8_t *)friend_id)) < 0) { |
349 | fputs("getfriend_id() failed on a valid ID!\n" | 350 | fputs("getfriend_id() failed on a valid ID!\n" |
350 | "this was CRITICAL to the test, and the build WILL fail.\n" | 351 | "this was CRITICAL to the test, and the build WILL fail.\n" |
351 | "the tests will continue now...\n\n", stderr); | 352 | "the tests will continue now...\n\n", stderr); |
353 | } | ||
352 | 354 | ||
353 | srunner_run_all(test_runner, CK_NORMAL); | 355 | srunner_run_all(test_runner, CK_NORMAL); |
354 | number_failed = srunner_ntests_failed(test_runner); | 356 | number_failed = srunner_ntests_failed(test_runner); |