Skip to content

Resolves build failures with IAR 8.x #9187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ LittleFileSystem fs("sd");

static char fslittle_fopen_utest_msg_g[FSLITTLE_UTEST_MSG_BUF_SIZE];
#define FSLITTLE_FOPEN_TEST_MOUNT_PT_NAME "sd"
#define FSLITTLE_FOPEN_TEST_MOUNT_PT_PATH "/"FSLITTLE_FOPEN_TEST_MOUNT_PT_NAME
#define FSLITTLE_FOPEN_TEST_MOUNT_PT_PATH "/" FSLITTLE_FOPEN_TEST_MOUNT_PT_NAME
#define FSLITTLE_FOPEN_TEST_WORK_BUF_SIZE_1 64
#define FSLITTLE_FOPEN_TEST_FILEPATH_MAX_DEPTH 20
static const int MAX_TEST_SIZE = 256 * 1024 * 2;
Expand Down Expand Up @@ -734,7 +734,6 @@ control_t fslittle_fopen_test_06(const size_t call_count)
control_t fslittle_fopen_test_07(const size_t call_count)
{
FILE *f = NULL;
int ret = -1;
int errno_val = 0;
const char *filename = sd_badfile_path;

Expand Down Expand Up @@ -1016,7 +1015,7 @@ control_t fslittle_fopen_test_11(const size_t call_count)
return CaseNext;
}


#if ! defined(__ARMCC_VERSION) && defined(__GNUC__)
/* file data for test_12 */
static fslittle_kv_data_t fslittle_fopen_test_12_kv_data[] = {
{ "/sd/test_12/subdir/testfil1.txt", "testfil1.txt"},
Expand All @@ -1026,6 +1025,7 @@ static fslittle_kv_data_t fslittle_fopen_test_12_kv_data[] = {
{ "/sd/test_12/testfil5.txt", "testfil5.txt"},
{ NULL, NULL},
};
#endif

/** @brief test for operation of readdir().
*
Expand All @@ -1036,6 +1036,7 @@ static fslittle_kv_data_t fslittle_fopen_test_12_kv_data[] = {
*/
control_t fslittle_fopen_test_12(const size_t call_count)
{
#if ! defined(__ARMCC_VERSION) && defined(__GNUC__)
char buf[FSLITTLE_FOPEN_TEST_WORK_BUF_SIZE_1];
char *pos = NULL;
int32_t count = 0;
Expand All @@ -1048,8 +1049,6 @@ control_t fslittle_fopen_test_12(const size_t call_count)
FSLITTLE_FENTRYLOG("%s:entered\n", __func__);
(void) call_count;

#if ! defined(__ARMCC_VERSION) && defined(__GNUC__)

/* start from a known state i.e. directory to be created in not present */
while (node->filename != NULL) {
fslittle_filepath_remove_all((char *) node->filename);
Expand Down Expand Up @@ -1156,13 +1155,15 @@ control_t fslittle_fopen_test_13(const size_t call_count)
return CaseNext;
}

#if ! defined(__ARMCC_VERSION) && defined(__GNUC__)
/* file data for test_14 */
static fslittle_kv_data_t fslittle_fopen_test_14_kv_data[] = {
/* a file is included in the filepath even though its not created by the test,
* as the fslittle_filepath_make_dirs() works with it present. */
{ "/sd/test_14/testfile.txt", "testdata"},
{ NULL, NULL},
};
#endif

/** @brief test for operation of stat()
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ DIR *dd[MBED_TEST_DIRS];
FILE *fd[MBED_TEST_FILES];
struct dirent ent;
struct dirent *ed;
size_t size;
uint8_t buffer[MBED_TEST_BUFFER];
uint8_t rbuffer[MBED_TEST_BUFFER];
uint8_t wbuffer[MBED_TEST_BUFFER];
Expand Down Expand Up @@ -107,6 +106,7 @@ void test_simple_file_test()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello", O_WRONLY | O_CREAT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ DIR *dd[MBED_TEST_DIRS];
FILE *fd[MBED_TEST_FILES];
struct dirent ent;
struct dirent *ed;
size_t size;
uint8_t buffer[MBED_TEST_BUFFER];
uint8_t rbuffer[MBED_TEST_BUFFER];
uint8_t wbuffer[MBED_TEST_BUFFER];
Expand All @@ -89,6 +88,7 @@ void test_seek_tests()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = MBED_TEST_FILESYSTEM::format(&bd);
TEST_ASSERT_EQUAL(0, res);
res = fs.mount(&bd);
Expand Down Expand Up @@ -271,6 +271,7 @@ void test_simple_file_seek()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello/kitty42", O_RDONLY);
Expand Down Expand Up @@ -318,7 +319,7 @@ void test_simple_file_seek()
res = memcmp(buffer, "kittycatcat", size);
TEST_ASSERT_EQUAL(0, res);

size_t size = file[0].size();
size = file[0].size();
res = file[0].seek(0, SEEK_CUR);
TEST_ASSERT_EQUAL(size, res);
res = file[0].close();
Expand All @@ -337,6 +338,7 @@ void test_large_file_seek()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello/kitty42", O_RDONLY);
Expand Down Expand Up @@ -384,7 +386,7 @@ void test_large_file_seek()
res = memcmp(buffer, "kittycatcat", size);
TEST_ASSERT_EQUAL(0, res);

size_t size = file[0].size();
size = file[0].size();
res = file[0].seek(0, SEEK_CUR);
TEST_ASSERT_EQUAL(size, res);
res = file[0].close();
Expand All @@ -403,6 +405,7 @@ void test_simple_file_seek_and_write()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello/kitty42", O_RDWR);
Expand Down Expand Up @@ -450,7 +453,7 @@ void test_simple_file_seek_and_write()
res = memcmp(buffer, "kittycatcat", size);
TEST_ASSERT_EQUAL(0, res);

size_t size = file[0].size();
size = file[0].size();
res = file[0].seek(0, SEEK_CUR);
TEST_ASSERT_EQUAL(size, res);
res = file[0].close();
Expand All @@ -469,6 +472,7 @@ void test_large_file_seek_and_write()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello/kitty42", O_RDWR);
Expand Down Expand Up @@ -518,7 +522,7 @@ void test_large_file_seek_and_write()
res = memcmp(buffer, "kittycatcat", size);
TEST_ASSERT_EQUAL(0, res);

size_t size = file[0].size();
size = file[0].size();
res = file[0].seek(0, SEEK_CUR);
TEST_ASSERT_EQUAL(size, res);
res = file[0].close();
Expand All @@ -537,6 +541,7 @@ void test_boundary_seek_and_write()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello/kitty42", O_RDWR);
Expand Down Expand Up @@ -583,6 +588,7 @@ void test_out_of_bounds_seek()
TEST_ASSERT_EQUAL(0, res);

{
size_t size;
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = file[0].open(&fs, "hello/kitty42", O_RDWR);
Expand Down