diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-26 16:15:07 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-26 16:15:07 -0700 |
commit | a1557e08e34da5055e6f832138968b72a91ad03d (patch) | |
tree | 66adcc93bd927792ad3fe42be4abe64fec616230 | |
parent | afa42503cdae82c535208d51bec8d4f9a920f6f0 (diff) | |
download | mu-a1557e08e34da5055e6f832138968b72a91ad03d.tar.gz |
1475
-rw-r--r-- | 050scenario.cc | 21 |
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; |