From 414b71e9f9755e6d49f58eb303abc484115e9048 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sat, 3 Mar 2018 23:39:46 +0100 Subject: mtd: tests: check erase block count in page test When there is only a single erase block, the cross erase test does not report sensible errors. Warn in case there is only a single erase block instead of executing the test. Signed-off-by: Stefan Agner Signed-off-by: David Oberhollenzer --- tests/mtd-tests/nandpagetest.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/mtd-tests/nandpagetest.c b/tests/mtd-tests/nandpagetest.c index c6812df..115cedb 100644 --- a/tests/mtd-tests/nandpagetest.c +++ b/tests/mtd-tests/nandpagetest.c @@ -551,8 +551,12 @@ int main(int argc, char **argv) } printf("verified %u eraseblocks\n", i); - if (crosstest()) - goto out; + if (ebcnt > 1) { + if (crosstest()) + goto out; + } else { + printf("skipping erasecrosstest, 2 erase blocks needed\n"); + } if (erasecrosstest()) goto out; -- cgit v1.2.3