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>
master-31012017
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;
for(r = 0; r < sizeof(buf); r++) {
buf[r] = r;
for(i = 0; i < sizeof(buf); i++) {
buf[i] = i;
}
if(cfs_seek(wfd, offset, CFS_SEEK_SET) != offset) {
@ -303,6 +303,8 @@ coffee_test_modify(void)
TEST_FAIL(8);
}
}
cfs_close(wfd);
}
error = 0;

View File

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