]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: integck: fail loudly on unexpected EROFS
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 26 Apr 2011 06:59:56 +0000 (09:59 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 29 Apr 2011 18:19:58 +0000 (21:19 +0300)
If we are not in power cut testing mode (-p was not used) and we get an
unexpected EROFS, we silently exit. This patch fixes this behavior and make
the test loudly fail instead.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
tests/fs-tests/integrity/integck.c

index bbbc7cb4ec1ceefb2f7ad25f761729786d84d34e..1dd424ed024b3c4e2b825623e855012f944cbef9 100644 (file)
                check_failed(stringify(cond), __func__, __FILE__, __LINE__); \
 } while(0)
 
-#define pcv(fmt, ...) do {                                         \
-       if (args.power_cut_mode && args.verbose)                   \
-               normsg(fmt " (line %d)", ##__VA_ARGS__, __LINE__); \
+#define pcv(fmt, ...) do {                                                   \
+       if (!args.power_cut_mode || (args.power_cut_mode && args.verbose))   \
+               normsg(fmt " (line %d)", ##__VA_ARGS__, __LINE__);           \
+       if (!args.power_cut_mode)                                            \
+               CHECK(0);                                                    \
 } while(0)
 
 /* The variables below are set by command line arguments */
@@ -3048,8 +3050,10 @@ int main(int argc, char *argv[])
                /*
                 * Iterate forever only in case of power-cut emulation testing.
                 */
-               if (!args.power_cut_mode)
+               if (!args.power_cut_mode) {
+                       CHECK(!ret);
                        break;
+               }
 
                CHECK(ret);
                CHECK(errno == EROFS);