diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-08 00:32:23 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-08 00:32:23 -0700 |
commit | 2b7a7498f98d1696adc2c6949f8d53f7fa18109e (patch) | |
tree | d42908812534d3f00528e137877fdeb5dd872772 | |
parent | 052535fd401bf3521efaf9e5775ad21ef1ec9eaa (diff) | |
download | mu-2b7a7498f98d1696adc2c6949f8d53f7fa18109e.tar.gz |
1034 - more test isolation
The layers are a mess now, but we'll take care of that later.
-rw-r--r-- | cpp/010vm | 2 | ||||
-rw-r--r-- | cpp/013run | 4 | ||||
-rw-r--r-- | cpp/025name | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/cpp/010vm b/cpp/010vm index 931ae673..5d3ddd53 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -141,6 +141,8 @@ void setup_recipes() { load("core.mu"); assert(Next_recipe_number < 100); Next_recipe_number = 100; + recipes_added_by_test.clear(); // Freeze everything added so far. + delete Trace_stream; Trace_stream = new trace_stream; :(before "End Setup") Next_recipe_number = 100; // consistent new numbers for each test diff --git a/cpp/013run b/cpp/013run index e226bc01..1ccbb3b3 100644 --- a/cpp/013run +++ b/cpp/013run @@ -104,6 +104,7 @@ void load(string filename) { } fin >> std::noskipws; add_recipes(fin); + transform_all(); fin.close(); } @@ -123,10 +124,11 @@ void run(string form) { :(before "End Setup") for (size_t i = 0; i < recipes_added_by_test.size(); ++i) { -//? cout << "AAA clearing " << Recipe[recipes_added_by_test[i]].name << '\n'; //? 1 +//? cout << "AAA clearing " << Recipe[recipes_added_by_test[i]].name << '\n'; //? 2 Recipe_number.erase(Recipe[recipes_added_by_test[i]].name); Recipe.erase(recipes_added_by_test[i]); } +// Clear state for recipes_added_by_test recipes_added_by_test.clear(); :(code) diff --git a/cpp/025name b/cpp/025name index 6f61234d..0c36d5ca 100644 --- a/cpp/025name +++ b/cpp/025name @@ -25,7 +25,7 @@ Transform.push_back(transform_names); unordered_map<recipe_number, unordered_map<string, int> > Name; :(before "End One-time Setup") Name.clear(); -:(before "recipes_added_by_test.clear()") +:(before "Clear state for recipes_added_by_test") for (size_t i = 0; i < recipes_added_by_test.size(); ++i) { Name.erase(recipes_added_by_test[i]); } |