@@ -317,7 +317,7 @@ static void FS_fwrite_with_fopen_r_mode()
317317}
318318
319319/* ----------------fread()------------------*/
320-
320+ # if !defined(__MICROLIB)
321321// fread with size zero
322322static void FS_fread_size_zero ()
323323{
@@ -344,6 +344,7 @@ static void FS_fread_size_zero()
344344 res = remove (" /default/" " filename" );
345345 TEST_ASSERT_EQUAL (0 , res);
346346}
347+ #endif
347348
348349// fread with nmemb zero
349350static void FS_fread_nmemb_zero ()
@@ -789,13 +790,14 @@ static void FS_fgets_with_fopen_w_mode()
789790
790791/* ----------------fflush()------------------*/
791792
793+ #if !defined(__MICROLIB)
792794// fflush with null
793795static void FS_fflush_null_stream ()
794796{
795797 int res = fflush (NULL );
796798 TEST_ASSERT_EQUAL (0 , res);
797799}
798-
800+ # endif
799801
800802// fflush valid flow
801803static void FS_fflush_valid_flow ()
@@ -1896,7 +1898,10 @@ static void FS_append_non_empty_file()
18961898
18971899 res = !((fd[0 ] = fopen (" /default/" " filename" , " a+" )) != NULL );
18981900 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
19001905 write_sz = fwrite (rewrite_buf, sizeof (char ), sizeof (rewrite_buf), fd[0 ]);
19011906 TEST_ASSERT_EQUAL (sizeof (write_buf), write_sz);
19021907
@@ -2034,8 +2039,9 @@ Case cases[] = {
20342039 Case (" FS_fwrite_nmemb_zero" , FS_fwrite_nmemb_zero),
20352040 Case (" FS_fwrite_valid_flow" , FS_fwrite_valid_flow),
20362041 Case (" FS_fwrite_with_fopen_r_mode" , FS_fwrite_with_fopen_r_mode),
2037-
2042+ # if !defined(__MICROLIB)
20382043 Case (" FS_fread_size_zero" , FS_fread_size_zero),
2044+ #endif
20392045 Case (" FS_fread_nmemb_zero" , FS_fread_nmemb_zero),
20402046 Case (" FS_fread_with_fopen_w_mode" , FS_fread_with_fopen_w_mode),
20412047 Case (" FS_fread_to_fwrite_file" , FS_fread_to_fwrite_file),
@@ -2055,8 +2061,9 @@ Case cases[] = {
20552061 Case (" FS_fgets_valid_flow" , FS_fgets_valid_flow),
20562062 Case (" FS_fgets_new_line" , FS_fgets_new_line),
20572063 Case (" FS_fgets_with_fopen_w_mode" , FS_fgets_with_fopen_w_mode),
2058-
2064+ # if !defined(__MICROLIB)
20592065 Case (" FS_fflush_null_stream" , FS_fflush_null_stream),
2066+ #endif
20602067 Case (" FS_fflush_valid_flow" , FS_fflush_valid_flow),
20612068 Case (" FS_fflush_twice" , FS_fflush_twice),
20622069
0 commit comments