* [PATCH] fs-tests: integck: fail loudly on unexpected EROFS
@ 2011-04-26 7:30 Artem Bityutskiy
0 siblings, 0 replies; only message in thread
From: Artem Bityutskiy @ 2011-04-26 7:30 UTC (permalink / raw)
To: MTD list; +Cc: Adrian Hunter
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
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 | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index bbbc7cb..1dd424e 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -69,9 +69,11 @@
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);
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-04-26 7:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-26 7:30 [PATCH] fs-tests: integck: fail loudly on unexpected EROFS Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).