Skip to content

Commit 9535de5

Browse files
author
Vincent Dupont
committed
squash spiffs: fix unittests
1 parent 06c41b7 commit 9535de5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/unittests/tests-spiffs/tests-spiffs.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,30 +111,30 @@ static void tests_spiffs_write2(void)
111111
buf[i] = 'A' + (i % 30);
112112
}
113113

114-
int mp = vfs_mount(&spiffs_file_system, "/", &spiffs_desc);
114+
int mp = vfs_mount(&_test_spiffs_mount);
115115
TEST_ASSERT(mp >= 0);
116116

117117
int res;
118-
for (int j = 0; j < 20; j++) {
119-
int fd = vfs_open("/test.txt", O_CREAT | O_RDWR, 0);
118+
for (int j = 0; j < 10; j++) {
119+
int fd = vfs_open("/test-spiffs/test.txt", O_CREAT | O_RDWR, 0);
120120
TEST_ASSERT(fd >= 0);
121121

122-
for (int i = 0; i < 1000; i++) {
122+
for (int i = 0; i < 500; i++) {
123123
res = vfs_write(fd, buf, sizeof(buf));
124124
TEST_ASSERT_EQUAL_INT(sizeof(buf), res);
125125
}
126126

127127
res = vfs_lseek(fd, 0, SEEK_SET);
128-
TEST_ASSERT(res == 0);
128+
TEST_ASSERT_EQUAL_INT(0, res);
129129

130130
res = vfs_close(fd);
131-
TEST_ASSERT(res == 0);
131+
TEST_ASSERT_EQUAL_INT(0, res);
132132

133-
res = vfs_unlink("/test.txt");
134-
TEST_ASSERT(res == 0);
133+
res = vfs_unlink("/test-spiffs/test.txt");
134+
TEST_ASSERT_EQUAL_INT(0, res);
135135
}
136136

137-
res = vfs_umount(mp);
137+
res = vfs_umount(&_test_spiffs_mount);
138138
TEST_ASSERT(res >= 0);
139139
}
140140

0 commit comments

Comments
 (0)