Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVincent Dupont <vincent@otakeys.com>2018-09-28 15:12:15 +0300
committerChristopher Haster <chaster@utexas.edu>2018-09-29 19:33:19 +0300
commit28d2d96a83dd238acc43523d2fba1223ad0c5ac2 (patch)
treedca18d0d537a400a242b747bf83b5d9479f0a26d /tests
parentcb62bf2188854c5b7c44383571ebb19a414e6137 (diff)
Fix -Wsign-compare error
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_alloc.sh6
-rwxr-xr-xtests/test_seek.sh2
-rwxr-xr-xtests/test_truncate.sh12
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_alloc.sh b/tests/test_alloc.sh
index 8c81490..6b3b181 100755
--- a/tests/test_alloc.sh
+++ b/tests/test_alloc.sh
@@ -32,18 +32,18 @@ lfs_alloc_singleproc() {
tests/test.py << TEST
const char *names[] = {"bacon", "eggs", "pancakes"};
lfs_mount(&lfs, &cfg) => 0;
- for (int n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
+ for (unsigned n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
sprintf((char*)buffer, "$1/%s", names[n]);
lfs_file_open(&lfs, &file[n], (char*)buffer,
LFS_O_WRONLY | LFS_O_CREAT | LFS_O_APPEND) => 0;
}
- for (int n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
+ for (unsigned n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
size = strlen(names[n]);
for (int i = 0; i < $SIZE; i++) {
lfs_file_write(&lfs, &file[n], names[n], size) => size;
}
}
- for (int n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
+ for (unsigned n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
lfs_file_close(&lfs, &file[n]) => 0;
}
lfs_unmount(&lfs) => 0;
diff --git a/tests/test_seek.sh b/tests/test_seek.sh
index 0084d42..aa8e643 100755
--- a/tests/test_seek.sh
+++ b/tests/test_seek.sh
@@ -301,7 +301,7 @@ tests/test.py << TEST
size = strlen("hedgehoghog");
const lfs_soff_t offsets[] = {512, 1020, 513, 1021, 511, 1019};
- for (int i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) {
+ for (unsigned i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) {
lfs_soff_t off = offsets[i];
memcpy(buffer, "hedgehoghog", size);
lfs_file_seek(&lfs, &file[0], off, LFS_SEEK_SET) => off;
diff --git a/tests/test_truncate.sh b/tests/test_truncate.sh
index da5ccaf..053b2e0 100755
--- a/tests/test_truncate.sh
+++ b/tests/test_truncate.sh
@@ -23,14 +23,14 @@ tests/test.py << TEST
lfs_mount(&lfs, &cfg) => 0;
- for (int i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
+ for (unsigned i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
sprintf((char*)buffer, "hairyhead%d", i);
lfs_file_open(&lfs, &file[0], (const char*)buffer,
LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
strcpy((char*)buffer, "hair");
size = strlen((char*)buffer);
- for (int j = 0; j < startsizes[i]; j += size) {
+ for (lfs_off_t j = 0; j < startsizes[i]; j += size) {
lfs_file_write(&lfs, &file[0], buffer, size) => size;
}
lfs_file_size(&lfs, &file[0]) => startsizes[i];
@@ -55,13 +55,13 @@ tests/test.py << TEST
lfs_mount(&lfs, &cfg) => 0;
- for (int i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
+ for (unsigned i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
sprintf((char*)buffer, "hairyhead%d", i);
lfs_file_open(&lfs, &file[0], (const char*)buffer, LFS_O_RDWR) => 0;
lfs_file_size(&lfs, &file[0]) => hotsizes[i];
size = strlen("hair");
- int j = 0;
+ lfs_off_t j = 0;
for (; j < startsizes[i] && j < hotsizes[i]; j += size) {
lfs_file_read(&lfs, &file[0], buffer, size) => size;
memcmp(buffer, "hair", size) => 0;
@@ -87,13 +87,13 @@ tests/test.py << TEST
lfs_mount(&lfs, &cfg) => 0;
- for (int i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
+ for (unsigned i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
sprintf((char*)buffer, "hairyhead%d", i);
lfs_file_open(&lfs, &file[0], (const char*)buffer, LFS_O_RDONLY) => 0;
lfs_file_size(&lfs, &file[0]) => coldsizes[i];
size = strlen("hair");
- int j = 0;
+ lfs_off_t j = 0;
for (; j < startsizes[i] && j < hotsizes[i] && j < coldsizes[i];
j += size) {
lfs_file_read(&lfs, &file[0], buffer, size) => size;