Skip to content

Commit

Permalink
add errno printing to spiffs compat rename test
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Apr 4, 2022
1 parent 2605da4 commit 20f14d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/test_littlefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,8 @@ TEST_CASE("SPIFFS COMPAT: file creation and rename", "[littlefs]")
{
test_setup();

int res;
char message[256];
const char* src = littlefs_base_path "/spiffs_compat/src/foo/bar/spiffs_compat.bin";
const char* dst = littlefs_base_path "/spiffs_compat/dst/foo/bar/spiffs_compat.bin";

Expand All @@ -1001,7 +1003,9 @@ TEST_CASE("SPIFFS COMPAT: file creation and rename", "[littlefs]")
TEST_ASSERT_TRUE(fputs("bar", f) != EOF);
TEST_ASSERT_EQUAL(0, fclose(f));

TEST_ASSERT_EQUAL(0, rename(src, dst));
res = rename(src, dst);
snprintf(message, sizeof(message), "errno: %d", errno);
TEST_ASSERT_EQUAL_MESSAGE(0, res, message);

/* check to see if all the directories were deleted */
struct stat sb;
Expand Down

0 comments on commit 20f14d2

Please sign in to comment.