summaryrefslogtreecommitdiff
path: root/auto_tests/save_load_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-25 12:16:54 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-08-25 15:25:33 +0000
commit94b06818fbd7a93387ff4c155b6eff711651aea9 (patch)
tree63365adeb88705c5c2f0cdb4d2afd00a4bd8b43c /auto_tests/save_load_test.c
parent0935aab92760a7c9c547faa86c29dcd0d1e03f24 (diff)
Use do-while instead of while in tests.
This forces all the loop bodies to be executed at least once, which is harmless since it just means one more tox event loop iteration. This reduces the jitter we see in coverage measurements, which is partially caused by loops sometimes being entered and sometimes not (because their condition happens to randomly already be true).
Diffstat (limited to 'auto_tests/save_load_test.c')
-rw-r--r--auto_tests/save_load_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/auto_tests/save_load_test.c b/auto_tests/save_load_test.c
index 57b2bda5..9c171602 100644
--- a/auto_tests/save_load_test.c
+++ b/auto_tests/save_load_test.c
@@ -63,7 +63,7 @@ static void test_few_clients(void)
63 63
64 uint8_t off = 1; 64 uint8_t off = 1;
65 65
66 while (1) { 66 while (true) {
67 tox_iterate(tox1, nullptr); 67 tox_iterate(tox1, nullptr);
68 tox_iterate(tox2, nullptr); 68 tox_iterate(tox2, nullptr);
69 tox_iterate(tox3, nullptr); 69 tox_iterate(tox3, nullptr);
@@ -103,7 +103,7 @@ static void test_few_clients(void)
103 cur_time = time(nullptr); 103 cur_time = time(nullptr);
104 off = 1; 104 off = 1;
105 105
106 while (1) { 106 while (true) {
107 tox_iterate(tox1, nullptr); 107 tox_iterate(tox1, nullptr);
108 tox_iterate(tox2, nullptr); 108 tox_iterate(tox2, nullptr);
109 tox_iterate(tox3, nullptr); 109 tox_iterate(tox3, nullptr);