test-coffee: Fix the file modification test

The r variable was used instead of i to fill the buffer, resulting in
the end of the test loop after only a single iteration. The file was not
even closed at the end of each iteration although it is opened at the
beginning of each iteration, so the available file descriptors would
very quickly be exhausted.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
Benoît Thébaudeau 2016-05-29 22:23:15 +02:00
parent 150b9fbd8b
commit 003b4b0d63
2 changed files with 5 additions and 3 deletions

View file

@ -276,8 +276,8 @@ coffee_test_modify(void)
offset = random_rand() % FILE_SIZE; offset = random_rand() % FILE_SIZE;
for(r = 0; r < sizeof(buf); r++) { for(i = 0; i < sizeof(buf); i++) {
buf[r] = r; buf[i] = i;
} }
if(cfs_seek(wfd, offset, CFS_SEEK_SET) != offset) { if(cfs_seek(wfd, offset, CFS_SEEK_SET) != offset) {
@ -303,6 +303,8 @@ coffee_test_modify(void)
TEST_FAIL(8); TEST_FAIL(8);
} }
} }
cfs_close(wfd);
} }
error = 0; error = 0;

View file

@ -89,7 +89,7 @@ make test-coffee.sky TARGET=sky</commands>
<plugin> <plugin>
org.contikios.cooja.plugins.ScriptRunner org.contikios.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>TIMEOUT(80000); <script>TIMEOUT(180000);
fileOK = null; fileOK = null;
gcOK = null; gcOK = null;