@@ -317,7 +317,7 @@ static void FS_fwrite_with_fopen_r_mode()
317
317
}
318
318
319
319
/* ----------------fread()------------------*/
320
-
320
+ # if !defined(__MICROLIB)
321
321
// fread with size zero
322
322
static void FS_fread_size_zero ()
323
323
{
@@ -344,6 +344,7 @@ static void FS_fread_size_zero()
344
344
res = remove (" /default/" " filename" );
345
345
TEST_ASSERT_EQUAL (0 , res);
346
346
}
347
+ #endif
347
348
348
349
// fread with nmemb zero
349
350
static void FS_fread_nmemb_zero ()
@@ -789,13 +790,14 @@ static void FS_fgets_with_fopen_w_mode()
789
790
790
791
/* ----------------fflush()------------------*/
791
792
793
+ #if !defined(__MICROLIB)
792
794
// fflush with null
793
795
static void FS_fflush_null_stream ()
794
796
{
795
797
int res = fflush (NULL );
796
798
TEST_ASSERT_EQUAL (0 , res);
797
799
}
798
-
800
+ # endif
799
801
800
802
// fflush valid flow
801
803
static void FS_fflush_valid_flow ()
@@ -1896,7 +1898,10 @@ static void FS_append_non_empty_file()
1896
1898
1897
1899
res = !((fd[0 ] = fopen (" /default/" " filename" , " a+" )) != NULL );
1898
1900
TEST_ASSERT_EQUAL (0 , res);
1899
-
1901
+ #if defined(__MICROLIB)
1902
+ // Microlib does not support opening a file in an append mode.
1903
+ fseek (fd[0 ], 0L , SEEK_END);
1904
+ #endif
1900
1905
write_sz = fwrite (rewrite_buf, sizeof (char ), sizeof (rewrite_buf), fd[0 ]);
1901
1906
TEST_ASSERT_EQUAL (sizeof (write_buf), write_sz);
1902
1907
@@ -2034,8 +2039,9 @@ Case cases[] = {
2034
2039
Case (" FS_fwrite_nmemb_zero" , FS_fwrite_nmemb_zero),
2035
2040
Case (" FS_fwrite_valid_flow" , FS_fwrite_valid_flow),
2036
2041
Case (" FS_fwrite_with_fopen_r_mode" , FS_fwrite_with_fopen_r_mode),
2037
-
2042
+ # if !defined(__MICROLIB)
2038
2043
Case (" FS_fread_size_zero" , FS_fread_size_zero),
2044
+ #endif
2039
2045
Case (" FS_fread_nmemb_zero" , FS_fread_nmemb_zero),
2040
2046
Case (" FS_fread_with_fopen_w_mode" , FS_fread_with_fopen_w_mode),
2041
2047
Case (" FS_fread_to_fwrite_file" , FS_fread_to_fwrite_file),
@@ -2055,8 +2061,9 @@ Case cases[] = {
2055
2061
Case (" FS_fgets_valid_flow" , FS_fgets_valid_flow),
2056
2062
Case (" FS_fgets_new_line" , FS_fgets_new_line),
2057
2063
Case (" FS_fgets_with_fopen_w_mode" , FS_fgets_with_fopen_w_mode),
2058
-
2064
+ # if !defined(__MICROLIB)
2059
2065
Case (" FS_fflush_null_stream" , FS_fflush_null_stream),
2066
+ #endif
2060
2067
Case (" FS_fflush_valid_flow" , FS_fflush_valid_flow),
2061
2068
Case (" FS_fflush_twice" , FS_fflush_twice),
2062
2069
0 commit comments