Skip to content

Commit ae1840d

Browse files
committed
fs cases: fix compile error
kernel/fs/cases/fs_stream_test.c:279:70: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=] 279 | syslog(LOG_ERR, "len = %zi != return value from fwrite = %zi", | ~~^ | | | long int | %i 280 | len, ret); | ~~~ | | | int kernel/fs/cases/fs_stream_test.c:311:69: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=] 311 | syslog(LOG_ERR, "len = %zi != return value from fread = %zi", | ~~^ | | | long int | %i 312 | len, ret); | ~~~ | | | int Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
1 parent 9c8a96a commit ae1840d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

testing/testsuites/kernel/fs/cases/fs_stream_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void test_nuttx_fs_stream03(FAR void **state)
247247
char *junk = "abcdefghijklmnopqrstuvwxyz";
248248
size_t len = strlen(junk);
249249
char *inbuf = NULL;
250-
int ret;
250+
size_t ret;
251251
int lc;
252252
for (lc = 0; lc < 10; lc++)
253253
{
@@ -264,7 +264,7 @@ void test_nuttx_fs_stream03(FAR void **state)
264264
assert_true(1 == 0);
265265
}
266266

267-
if ((size_t)ret != len)
267+
if (ret != len)
268268
{
269269
syslog(LOG_ERR,
270270
"len = %zi != return value from fwrite = %i",
@@ -297,7 +297,7 @@ void test_nuttx_fs_stream03(FAR void **state)
297297
assert_true(1 == 0);
298298
}
299299

300-
if ((size_t)ret != len)
300+
if (ret != len)
301301
{
302302
syslog(LOG_ERR,
303303
"len = %zi != return value from fread = %i",

0 commit comments

Comments
 (0)