summaryrefslogtreecommitdiff
path: root/auto_tests/file_transfer_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-17 01:18:04 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-22 02:34:30 +0000
commitf627a26a7b1c3619ba66f84b87092ff8ba7a95b6 (patch)
treec72c950fab473dc9bec4b5329d251b790e55443d /auto_tests/file_transfer_test.c
parent7245ac11ef9be2420c8356c12acc79f93ea211bb (diff)
Run Clang global static analysis on Travis.
This uses a single .cc file containing almost all the code in the repository to perform whole program analysis.
Diffstat (limited to 'auto_tests/file_transfer_test.c')
-rw-r--r--auto_tests/file_transfer_test.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/auto_tests/file_transfer_test.c b/auto_tests/file_transfer_test.c
index a6e45431..94bdb42f 100644
--- a/auto_tests/file_transfer_test.c
+++ b/auto_tests/file_transfer_test.c
@@ -140,20 +140,18 @@ static void tox_file_chunk_request(Tox *tox, uint32_t friend_number, uint32_t fi
140 m_send_reached = 1; 140 m_send_reached = 1;
141 } 141 }
142 142
143 TOX_ERR_FILE_SEND_CHUNK error;
144 VLA(uint8_t, f_data, length); 143 VLA(uint8_t, f_data, length);
145 memset(f_data, sending_num, length); 144 memset(f_data, sending_num, length);
146 145
147 if (tox_file_send_chunk(tox, friend_number, file_number, position, f_data, length, &error)) { 146 TOX_ERR_FILE_SEND_CHUNK error;
148 ++sending_num; 147 tox_file_send_chunk(tox, friend_number, file_number, position, f_data, length, &error);
149 sending_pos += length;
150 } else {
151 ck_abort_msg("Could not send chunk, error num=%d pos=%d len=%d", (int)error, (int)position, (int)length);
152 }
153 148
154 if (error != TOX_ERR_FILE_SEND_CHUNK_OK) { 149 if (error != TOX_ERR_FILE_SEND_CHUNK_OK) {
155 ck_abort_msg("Wrong error code"); 150 ck_abort_msg("Could not send chunk, error num=%d pos=%d len=%d", (int)error, (int)position, (int)length);
156 } 151 }
152
153 ++sending_num;
154 sending_pos += length;
157} 155}
158 156
159 157