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:
parent
150b9fbd8b
commit
003b4b0d63
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue