Skip to content

Commit 6873044

Browse files
committed
littlefs: Updated error codes in tests to match version update
1 parent 1e74c9c commit 6873044

File tree

2 files changed

+7
-8
lines changed
  • features/filesystem/littlefs/TESTS

2 files changed

+7
-8
lines changed

features/filesystem/littlefs/TESTS/filesystem/dirs/main.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "unity.h"
1919
#include "utest.h"
2020
#include <stdlib.h>
21-
#include <errno.h>
2221

2322
using namespace utest::v1;
2423

@@ -354,7 +353,7 @@ void test_directory_remove()
354353
res = fs.mount(&bd);
355354
TEST_ASSERT_EQUAL(0, res);
356355
res = fs.remove("potato");
357-
TEST_ASSERT_EQUAL(-EINVAL, res);
356+
TEST_ASSERT_EQUAL(-ENOTEMPTY, res);
358357
res = fs.remove("potato/sweet");
359358
TEST_ASSERT_EQUAL(0, res);
360359
res = fs.remove("potato/baked");
@@ -536,7 +535,7 @@ void test_directory_rename()
536535
res = fs.mkdir("warmpotato/mushy", 0777);
537536
TEST_ASSERT_EQUAL(0, res);
538537
res = fs.rename("hotpotato", "warmpotato");
539-
TEST_ASSERT_EQUAL(-EINVAL, res);
538+
TEST_ASSERT_EQUAL(-ENOTEMPTY, res);
540539
res = fs.remove("warmpotato/mushy");
541540
TEST_ASSERT_EQUAL(0, res);
542541
res = fs.rename("hotpotato", "warmpotato");
@@ -600,7 +599,7 @@ void test_directory_rename()
600599
res = fs.rename("warmpotato/fried", "coldpotato/fried");
601600
TEST_ASSERT_EQUAL(0, res);
602601
res = fs.remove("coldpotato");
603-
TEST_ASSERT_EQUAL(-EINVAL, res);
602+
TEST_ASSERT_EQUAL(-ENOTEMPTY, res);
604603
res = fs.remove("warmpotato");
605604
TEST_ASSERT_EQUAL(0, res);
606605
res = fs.unmount();

features/filesystem/littlefs/TESTS/filesystem_retarget/dirs/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
#include <errno.h>
1617
#include "mbed.h"
1718
#include "greentea-client/test_env.h"
1819
#include "unity.h"
1920
#include "utest.h"
2021
#include <stdlib.h>
21-
#include <errno.h>
2222

2323
using namespace utest::v1;
2424

@@ -354,7 +354,7 @@ void test_directory_remove()
354354
res = fs.mount(&bd);
355355
TEST_ASSERT_EQUAL(0, res);
356356
res = remove("/fs/" "potato");
357-
TEST_ASSERT_EQUAL(EINVAL, errno);
357+
TEST_ASSERT_EQUAL(ENOTEMPTY, errno);
358358
res = remove("/fs/" "potato/sweet");
359359
TEST_ASSERT_EQUAL(0, res);
360360
res = remove("/fs/" "potato/baked");
@@ -536,7 +536,7 @@ void test_directory_rename()
536536
res = mkdir("/fs/" "warmpotato/mushy", 0777);
537537
TEST_ASSERT_EQUAL(0, res);
538538
res = rename("/fs/" "hotpotato", "/fs/" "warmpotato");
539-
TEST_ASSERT_EQUAL(EINVAL, errno);
539+
TEST_ASSERT_EQUAL(ENOTEMPTY, errno);
540540
res = remove("/fs/" "warmpotato/mushy");
541541
TEST_ASSERT_EQUAL(0, res);
542542
res = rename("/fs/" "hotpotato", "/fs/" "warmpotato");
@@ -600,7 +600,7 @@ void test_directory_rename()
600600
res = rename("/fs/" "warmpotato/fried", "/fs/" "coldpotato/fried");
601601
TEST_ASSERT_EQUAL(0, res);
602602
res = remove("/fs/" "coldpotato");
603-
TEST_ASSERT_EQUAL(EINVAL, errno);
603+
TEST_ASSERT_EQUAL(ENOTEMPTY, errno);
604604
res = remove("/fs/" "warmpotato");
605605
TEST_ASSERT_EQUAL(0, res);
606606
res = fs.unmount();

0 commit comments

Comments
 (0)