diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-06-30 12:31:06 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-06-30 12:31:06 +0200 |
commit | 1a6b2b9c1ebd127a662051393d266e2815d09524 (patch) | |
tree | ce18d2597a2e61d56247360b20ee8e05942fade3 /src/systemcmds/tests/test_file2.c | |
parent | 72071cdcd39cae6be8533e67d01cbc7533ca6cb1 (diff) | |
parent | 857b843d445f59f2dc393e4d5f879fc56f77a0e0 (diff) | |
download | px4-firmware-1a6b2b9c1ebd127a662051393d266e2815d09524.tar.gz px4-firmware-1a6b2b9c1ebd127a662051393d266e2815d09524.tar.bz2 px4-firmware-1a6b2b9c1ebd127a662051393d266e2815d09524.zip |
Merge branch 'master' into dataman_state_nav_rewrite
Diffstat (limited to 'src/systemcmds/tests/test_file2.c')
-rw-r--r-- | src/systemcmds/tests/test_file2.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/systemcmds/tests/test_file2.c b/src/systemcmds/tests/test_file2.c index ef555f6c3..8db3ea5ae 100644 --- a/src/systemcmds/tests/test_file2.c +++ b/src/systemcmds/tests/test_file2.c @@ -49,6 +49,8 @@ #include <stdlib.h> #include <getopt.h> +#include "tests.h" + #define FLAG_FSYNC 1 #define FLAG_LSEEK 2 @@ -85,9 +87,9 @@ static void test_corruption(const char *filename, uint32_t write_chunk, uint32_t buffer[j] = get_value(ofs); ofs++; } - if (write(fd, buffer, sizeof(buffer)) != sizeof(buffer)) { - printf("write failed at offset %u\n", ofs); - exit(1); + if (write(fd, buffer, sizeof(buffer)) != (int)sizeof(buffer)) { + printf("write failed at offset %u\n", ofs); + exit(1); } if (flags & FLAG_FSYNC) { fsync(fd); @@ -116,7 +118,7 @@ static void test_corruption(const char *filename, uint32_t write_chunk, uint32_t printf("read ofs=%u\r", ofs); } counter++; - if (read(fd, buffer, sizeof(buffer)) != sizeof(buffer)) { + if (read(fd, buffer, sizeof(buffer)) != (int)sizeof(buffer)) { printf("read failed at offset %u\n", ofs); exit(1); } |