From 2b7a7498f98d1696adc2c6949f8d53f7fa18109e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 8 Apr 2015 00:32:23 -0700 Subject: 1034 - more test isolation The layers are a mess now, but we'll take care of that later. --- cpp/010vm | 2 ++ cpp/013run | 4 +++- 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 > 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]); } -- cgit 1.4.1-2-gfad0