about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-26 16:15:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-26 16:15:07 -0700
commita1557e08e34da5055e6f832138968b72a91ad03d (patch)
tree66adcc93bd927792ad3fe42be4abe64fec616230
parentafa42503cdae82c535208d51bec8d4f9a920f6f0 (diff)
downloadmu-a1557e08e34da5055e6f832138968b72a91ad03d.tar.gz
1475
-rw-r--r--050scenario.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/050scenario.cc b/050scenario.cc
index 8df08e77..c4acc688 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -220,11 +220,18 @@ void check_memory(const string& s) {
       raise << "duplicate expectation for location " << address << '\n';
     trace(Primitive_recipe_depth, "run") << "checking location " << address;
     if (Memory[address] != value) {
-      if (Current_scenario)
+      if (Current_scenario && !Hide_warnings) {
+        // genuine test in a mu file
         raise << "\nF - " << Current_scenario->name << ": expected location " << address << " to contain " << value << " but saw " << Memory[address] << '\n';
-      else
+      }
+      else {
+        // just testing scenario support
         raise << "expected location " << address << " to contain " << value << " but saw " << Memory[address] << '\n';
-      Passed = false;
+      }
+      if (!Hide_warnings) {
+        Passed = false;
+        ++Num_failures;
+      }
       return;
     }
     locations_checked.insert(address);
@@ -267,10 +274,14 @@ void check_string(long long int address, const string& literal) {
   for (long long int i = 0; i < SIZE(literal); ++i) {
     trace(Primitive_recipe_depth, "run") << "checking location " << address+i;
     if (Memory[address+i] != literal.at(i)) {
-      if (Current_scenario && !Hide_warnings)
+      if (Current_scenario && !Hide_warnings) {
+        // genuine test in a mu file
         raise << "\nF - " << Current_scenario->name << ": expected location " << (address+i) << " to contain " << literal.at(i) << " but saw " << Memory[address+i] << '\n';
-      else
+      }
+      else {
+        // just testing scenario support
         raise << "expected location " << (address+i) << " to contain " << literal.at(i) << " but saw " << Memory[address+i] << '\n';
+      }
       if (!Hide_warnings) {
         Passed = false;
         ++Num_failures;