aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/libmtd_test.c4
-rw-r--r--tests/unittests/sysfs_mock/class/mtd/mtd0/oobavail1
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/unittests/libmtd_test.c b/tests/unittests/libmtd_test.c
index db1564a..633d94a 100644
--- a/tests/unittests/libmtd_test.c
+++ b/tests/unittests/libmtd_test.c
@@ -42,6 +42,7 @@ static void test_libmtd_open(void **state)
assert_string_equal(lib->mtd_min_io_size, SYSFS_ROOT "/class/mtd/mtd%d/writesize");
assert_string_equal(lib->mtd_subpage_size, SYSFS_ROOT "/class/mtd/mtd%d/subpagesize");
assert_string_equal(lib->mtd_oob_size, SYSFS_ROOT "/class/mtd/mtd%d/oobsize");
+ assert_string_equal(lib->mtd_oobavail, SYSFS_ROOT "/class/mtd/mtd%d/oobavail");
assert_string_equal(lib->mtd_region_cnt, SYSFS_ROOT "/class/mtd/mtd%d/numeraseregions");
assert_string_equal(lib->mtd_flags, SYSFS_ROOT "/class/mtd/mtd%d/flags");
@@ -449,6 +450,9 @@ static void test_mtd_get_dev_info1(void **state)
expect_open(SYSFS_ROOT "/class/mtd/mtd0/oobsize", O_RDONLY, 0);
expect_read_real(50,0);
expect_close(3,1);
+ expect_open(SYSFS_ROOT "/class/mtd/mtd0/oobavail", O_RDONLY, 0);
+ expect_read_real(50,0);
+ expect_close(3,1);
expect_open(SYSFS_ROOT "/class/mtd/mtd0/numeraseregions", O_RDONLY, 0);
expect_read_real(50,0);
expect_close(3,1);
diff --git a/tests/unittests/sysfs_mock/class/mtd/mtd0/oobavail b/tests/unittests/sysfs_mock/class/mtd/mtd0/oobavail
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/tests/unittests/sysfs_mock/class/mtd/mtd0/oobavail
@@ -0,0 +1 @@
+8