Skip to content

Commit 3091834

Browse files
authored
Merge pull request #12111 from rajkan01/feature_feof_disable
Microlib: Disable feof function usage in general filesystem test
2 parents e28daf7 + 95f56ba commit 3091834

File tree

1 file changed

+18
-1
lines changed
  • features/storage/TESTS/filesystem/general_filesystem

1 file changed

+18
-1
lines changed

features/storage/TESTS/filesystem/general_filesystem/main.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,11 @@ static void FS_fseek_beyond_empty_file_seek_set()
10271027

10281028
int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]);
10291029
TEST_ASSERT_EQUAL(0, read_sz);
1030-
1030+
#if !defined(__MICROLIB)
1031+
// feof() always returns 0 because the EOF indicator is not supported by Microlib
10311032
res = feof(fd[0]);
10321033
TEST_ASSERT_NOT_EQUAL(0, res);
1034+
#endif
10331035

10341036
res = fclose(fd[0]);
10351037
TEST_ASSERT_EQUAL(0, res);
@@ -1062,8 +1064,11 @@ static void FS_fseek_beyond_non_empty_file_seek_set()
10621064
int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]);
10631065
TEST_ASSERT_EQUAL(0, read_sz);
10641066

1067+
#if !defined(__MICROLIB)
1068+
// feof() always returns 0 because the EOF indicator is not supported by Microlib
10651069
res = feof(fd[0]);
10661070
TEST_ASSERT_NOT_EQUAL(0, res);
1071+
#endif
10671072

10681073
res = fclose(fd[0]);
10691074
TEST_ASSERT_EQUAL(0, res);
@@ -1147,8 +1152,11 @@ static void FS_fseek_beyond_empty_file_seek_cur()
11471152
int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]);
11481153
TEST_ASSERT_EQUAL(0, read_sz);
11491154

1155+
#if !defined(__MICROLIB)
1156+
// feof() always returns 0 because the EOF indicator is not supported by Microlib
11501157
res = feof(fd[0]);
11511158
TEST_ASSERT_NOT_EQUAL(0, res);
1159+
#endif
11521160

11531161
res = fclose(fd[0]);
11541162
TEST_ASSERT_EQUAL(0, res);
@@ -1181,8 +1189,11 @@ static void FS_fseek_beyond_non_empty_file_seek_cur()
11811189
int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]);
11821190
TEST_ASSERT_EQUAL(0, read_sz);
11831191

1192+
#if !defined(__MICROLIB)
1193+
// feof() always returns 0 because the EOF indicator is not supported by Microlib
11841194
res = feof(fd[0]);
11851195
TEST_ASSERT_NOT_EQUAL(0, res);
1196+
#endif
11861197

11871198
res = fclose(fd[0]);
11881199
TEST_ASSERT_EQUAL(0, res);
@@ -1266,8 +1277,11 @@ static void FS_fseek_beyond_empty_file_seek_end()
12661277
int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]);
12671278
TEST_ASSERT_EQUAL(0, read_sz);
12681279

1280+
#if !defined(__MICROLIB)
1281+
// feof() always returns 0 because the EOF indicator is not supported by Microlib
12691282
res = feof(fd[0]);
12701283
TEST_ASSERT_NOT_EQUAL(0, res);
1284+
#endif
12711285

12721286
res = fclose(fd[0]);
12731287
TEST_ASSERT_EQUAL(0, res);
@@ -1300,8 +1314,11 @@ static void FS_fseek_beyond_non_empty_file_seek_end()
13001314
int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]);
13011315
TEST_ASSERT_EQUAL(0, read_sz);
13021316

1317+
#if !defined(__MICROLIB)
1318+
// feof() always returns 0 because the EOF indicator is not supported by Microlib
13031319
res = feof(fd[0]);
13041320
TEST_ASSERT_NOT_EQUAL(0, res);
1321+
#endif
13051322

13061323
res = fclose(fd[0]);
13071324
TEST_ASSERT_EQUAL(0, res);

0 commit comments

Comments
 (0)