diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-12 16:48:35 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-16 12:06:02 +0100 |
commit | 1494e474dde58ec6e446cdbfad9a8d89f6c4796c (patch) | |
tree | e454a18a0f61468d10833d8e80039d025f94f568 /auto_tests/messenger_test.c | |
parent | 37c041f8159f7e89f2585243e9b8073f47d77fd1 (diff) |
Ensure that all TODOs have an owner.
In the future, all TODOs added either need a bug number (TODO(#NN)) or a
person's github user name. By default, I made irungentoo the owner of
all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner
of API TODOs.
Diffstat (limited to 'auto_tests/messenger_test.c')
-rw-r--r-- | auto_tests/messenger_test.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c index 8f904ed1..5d0be284 100644 --- a/auto_tests/messenger_test.c +++ b/auto_tests/messenger_test.c | |||
@@ -120,7 +120,8 @@ START_TEST(test_m_delfriend) | |||
120 | REALLY_BIG_NUMBER); | 120 | REALLY_BIG_NUMBER); |
121 | } | 121 | } |
122 | END_TEST | 122 | END_TEST |
123 | /* | 123 | |
124 | #if 0 | ||
124 | START_TEST(test_m_addfriend) | 125 | START_TEST(test_m_addfriend) |
125 | { | 126 | { |
126 | char *good_data = "test"; | 127 | char *good_data = "test"; |
@@ -129,30 +130,34 @@ START_TEST(test_m_addfriend) | |||
129 | int good_len = strlen(good_data); | 130 | int good_len = strlen(good_data); |
130 | int bad_len = strlen(bad_data); | 131 | int bad_len = strlen(bad_data); |
131 | int really_bad_len = (MAX_CRYPTO_PACKET_SIZE - crypto_box_PUBLICKEYBYTES | 132 | int really_bad_len = (MAX_CRYPTO_PACKET_SIZE - crypto_box_PUBLICKEYBYTES |
132 | - crypto_box_NONCEBYTES - crypto_box_BOXZEROBYTES | 133 | - crypto_box_NONCEBYTES - crypto_box_BOXZEROBYTES |
133 | + crypto_box_ZEROBYTES + 100); */ | 134 | + crypto_box_ZEROBYTES + 100); |
134 | /* TODO: Update this properly to latest master | 135 | |
135 | if(m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, really_bad_len) != FAERR_TOOLONG) | 136 | /* TODO(irungentoo): Update this properly to latest master */ |
137 | if (m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, really_bad_len) != FAERR_TOOLONG) { | ||
136 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", really_bad_len); | 138 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", really_bad_len); |
137 | */ | 139 | } |
138 | /* this will return an error if the original m_addfriend_norequest() failed */ | 140 | |
139 | /* if(m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, good_len) != FAERR_ALREADYSENT) | 141 | /* this will return an error if the original m_addfriend_norequest() failed */ |
142 | if (m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, good_len) != FAERR_ALREADYSENT) { | ||
140 | ck_abort_msg("m_addfriend did NOT catch adding a friend we already have.\n" | 143 | ck_abort_msg("m_addfriend did NOT catch adding a friend we already have.\n" |
141 | "(this can be caused by the error of m_addfriend_norequest in" | 144 | "(this can be caused by the error of m_addfriend_norequest in" |
142 | " the beginning of the suite)\n"); | 145 | " the beginning of the suite)\n"); |
146 | } | ||
143 | 147 | ||
144 | if(m_addfriend(m, (uint8_t *)good_id_b, (uint8_t *)bad_data, bad_len) != FAERR_NOMESSAGE) | 148 | if (m_addfriend(m, (uint8_t *)good_id_b, (uint8_t *)bad_data, bad_len) != FAERR_NOMESSAGE) { |
145 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", bad_len); | 149 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", bad_len); |
146 | */ | 150 | } |
147 | /* this should REALLY return an error */ | ||
148 | /* | ||
149 | * TODO: validate client_id in m_addfriend? | ||
150 | if(m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0) | ||
151 | ck_abort_msg("The following ID passed through " | ||
152 | "m_addfriend without an error:\n'%s'\n", bad_id_str); | ||
153 | 151 | ||
152 | /* this should REALLY return an error */ | ||
153 | /* TODO(irungentoo): validate client_id in m_addfriend? */ | ||
154 | if (m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0) { | ||
155 | ck_abort_msg("The following ID passed through " | ||
156 | "m_addfriend without an error:\n'%s'\n", bad_id_str); | ||
157 | } | ||
154 | } | 158 | } |
155 | END_TEST */ | 159 | END_TEST |
160 | #endif | ||
156 | 161 | ||
157 | START_TEST(test_setname) | 162 | START_TEST(test_setname) |
158 | { | 163 | { |