From 95f56bac30ff165e71bd3abba8003d5695e915f0 Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Wed, 11 Dec 2019 07:32:32 -0800 Subject: [PATCH] Microlib: Disable feof function usage in tests feof function is not supported in Microlib library. so disabling all the feof function usage in the green tea test. --- .../filesystem/general_filesystem/main.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/features/storage/TESTS/filesystem/general_filesystem/main.cpp b/features/storage/TESTS/filesystem/general_filesystem/main.cpp index ca14531288..be7e025945 100644 --- a/features/storage/TESTS/filesystem/general_filesystem/main.cpp +++ b/features/storage/TESTS/filesystem/general_filesystem/main.cpp @@ -1027,9 +1027,11 @@ static void FS_fseek_beyond_empty_file_seek_set() int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]); TEST_ASSERT_EQUAL(0, read_sz); - +#if !defined(__MICROLIB) + // feof() always returns 0 because the EOF indicator is not supported by Microlib res = feof(fd[0]); TEST_ASSERT_NOT_EQUAL(0, res); +#endif res = fclose(fd[0]); TEST_ASSERT_EQUAL(0, res); @@ -1062,8 +1064,11 @@ static void FS_fseek_beyond_non_empty_file_seek_set() int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]); TEST_ASSERT_EQUAL(0, read_sz); +#if !defined(__MICROLIB) + // feof() always returns 0 because the EOF indicator is not supported by Microlib res = feof(fd[0]); TEST_ASSERT_NOT_EQUAL(0, res); +#endif res = fclose(fd[0]); TEST_ASSERT_EQUAL(0, res); @@ -1147,8 +1152,11 @@ static void FS_fseek_beyond_empty_file_seek_cur() int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]); TEST_ASSERT_EQUAL(0, read_sz); +#if !defined(__MICROLIB) + // feof() always returns 0 because the EOF indicator is not supported by Microlib res = feof(fd[0]); TEST_ASSERT_NOT_EQUAL(0, res); +#endif res = fclose(fd[0]); TEST_ASSERT_EQUAL(0, res); @@ -1181,8 +1189,11 @@ static void FS_fseek_beyond_non_empty_file_seek_cur() int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]); TEST_ASSERT_EQUAL(0, read_sz); +#if !defined(__MICROLIB) + // feof() always returns 0 because the EOF indicator is not supported by Microlib res = feof(fd[0]); TEST_ASSERT_NOT_EQUAL(0, res); +#endif res = fclose(fd[0]); TEST_ASSERT_EQUAL(0, res); @@ -1266,8 +1277,11 @@ static void FS_fseek_beyond_empty_file_seek_end() int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]); TEST_ASSERT_EQUAL(0, read_sz); +#if !defined(__MICROLIB) + // feof() always returns 0 because the EOF indicator is not supported by Microlib res = feof(fd[0]); TEST_ASSERT_NOT_EQUAL(0, res); +#endif res = fclose(fd[0]); TEST_ASSERT_EQUAL(0, res); @@ -1300,8 +1314,11 @@ static void FS_fseek_beyond_non_empty_file_seek_end() int read_sz = fread(read_buf, sizeof(char), sizeof(read_buf), fd[0]); TEST_ASSERT_EQUAL(0, read_sz); +#if !defined(__MICROLIB) + // feof() always returns 0 because the EOF indicator is not supported by Microlib res = feof(fd[0]); TEST_ASSERT_NOT_EQUAL(0, res); +#endif res = fclose(fd[0]); TEST_ASSERT_EQUAL(0, res);