about summary refs log tree commit diff stats
path: root/002test.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-20 20:22:12 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-20 20:22:12 -0700
commiteef0251c591a25e0405568869cb3542daae8b6f5 (patch)
treec705c8a17a851e562a43a6a14a83ba7423b54bee /002test.cc
parentdddc384c5124febdf111730fa760dcb6a06e7155 (diff)
downloadmu-eef0251c591a25e0405568869cb3542daae8b6f5.tar.gz
3532
Coalesce all the management of number of failed scenarios.
Diffstat (limited to '002test.cc')
-rw-r--r--002test.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/002test.cc b/002test.cc
index eeea02a3..6bb71b6c 100644
--- a/002test.cc
+++ b/002test.cc
@@ -24,7 +24,6 @@ long Num_failures = 0;
 :(before "End Includes")
 #define CHECK(X) \
   if (Passed && !(X)) { \
-    ++Num_failures; \
     cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << '\n'; \
     Passed = false; \
     return;  /* Currently we stop at the very first failure. */ \
@@ -32,7 +31,6 @@ long Num_failures = 0;
 
 #define CHECK_EQ(X, Y) \
   if (Passed && (X) != (Y)) { \
-    ++Num_failures; \
     cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << " == " << #Y << '\n'; \
     cerr << "  got " << (X) << '\n';  /* BEWARE: multiple eval */ \
     Passed = false; \
@@ -82,6 +80,7 @@ void run_test(size_t i) {
   // End Test Teardown
   teardown();
   if (Passed) cerr << '.';
+  else ++Num_failures;
 }
 
 bool is_integer(const string& s) {