summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2018-04-16 17:37:00 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2018-04-16 17:37:00 +0200
commit9ea54375c3ed1ba1c4ec8f6ddf80615fcb7fb073 (patch)
tree297d481ac79a96be4e7c7e3f875be651e61e329e /tests/unittests
parentba145d80e239fdac6414b347568c62bc2f6cb9a2 (diff)
Fix unit test mockup for oobavail sysfs file
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/unittests')
-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