mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-08-07 18:25:14 +00:00
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:
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user