]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd: tests: check erase block count in page test
authorStefan Agner <stefan@agner.ch>
Sat, 3 Mar 2018 22:39:46 +0000 (23:39 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Mon, 5 Mar 2018 11:22:39 +0000 (12:22 +0100)
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 <stefan@agner.ch>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
tests/mtd-tests/nandpagetest.c

index c6812df21e2abb51ef186785b7cfebd70cf354f0..115cedb7022579026a5fa419aaf5f17b1559cb28 100644 (file)
@@ -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;