about summary refs log tree commit diff stats
path: root/003trace.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-19 20:53:00 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-19 20:53:18 -0800
commit7163e18a774781c62f0c0542e4cb9037f6a71d22 (patch)
tree6cb88378652a2124ce701d8d96428fbc8fb8f552 /003trace.cc
parentff9d5f43cfcc18e853de8d92ade1f962961fa516 (diff)
downloadmu-7163e18a774781c62f0c0542e4cb9037f6a71d22.tar.gz
2575 - better messages on trace count failures
Diffstat (limited to '003trace.cc')
-rw-r--r--003trace.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/003trace.cc b/003trace.cc
index 5b48f1c4..4b254919 100644
--- a/003trace.cc
+++ b/003trace.cc
@@ -272,6 +272,16 @@ int trace_count(string label, string line) {
     return; \
   }
 
+#define CHECK_TRACE_COUNT(label, count) \
+  if (trace_count(label) != (count)) { \
+    ++Num_failures; \
+    cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): trace_count of " << label << " should be " << count << '\n'; \
+    cerr << "  got " << trace_count(label) << '\n';  /* multiple eval */ \
+    DUMP(label); \
+    Passed = false; \
+    return;  /* Currently we stop at the very first failure. */ \
+  }
+
 bool trace_doesnt_contain(string label, string line) {
   return trace_count(label, line) == 0;
 }