From 9ea54375c3ed1ba1c4ec8f6ddf80615fcb7fb073 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 16 Apr 2018 17:37:00 +0200 Subject: Fix unit test mockup for oobavail sysfs file Signed-off-by: David Oberhollenzer --- tests/unittests/libmtd_test.c | 4 ++++ tests/unittests/sysfs_mock/class/mtd/mtd0/oobavail | 1 + 2 files changed, 5 insertions(+) create mode 100644 tests/unittests/sysfs_mock/class/mtd/mtd0/oobavail (limited to 'tests') 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 -- cgit v1.2.3