diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/001test | 1 | ||||
-rw-r--r-- | cpp/010vm | 2 | ||||
-rw-r--r-- | cpp/050scenario | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/cpp/001test b/cpp/001test index 0db10e4b..2319348b 100644 --- a/cpp/001test +++ b/cpp/001test @@ -49,6 +49,7 @@ if (argc == 2 && is_equal(argv[1], "test")) { } // pass in a set of line numbers in test_file to run just those tests if (argc > 2 && is_equal(argv[1], "test") && is_number(argv[2])) { + assert(Next_recipe_number < 1000); // see vm layer for (int i = 2; i < argc; ++i) { run_test(to_int(argv[i])-1); } diff --git a/cpp/010vm b/cpp/010vm index 0a1ada2c..0dbafc03 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -153,6 +153,8 @@ assert(MAX_PRIMITIVE_RECIPES < 100); // level 0 is primitives; until 99 Next_recipe_number = 100; // End Load Recipes delete Trace_stream; Trace_stream = new trace_stream; +:(after "void run_tests()") +assert(Next_recipe_number < 1000); // functions being tested didn't overflow into test space :(before "End Setup") Next_recipe_number = 1000; // consistent new numbers for each test diff --git a/cpp/050scenario b/cpp/050scenario index 34edbe71..1dfc36bf 100644 --- a/cpp/050scenario +++ b/cpp/050scenario @@ -21,6 +21,7 @@ run_mu_tests(); :(code) void run_mu_tests() { + assert(Next_recipe_number < 1000); // don't load into test space for (size_t i = 0; i < Scenarios.size(); ++i) { setup(); Trace_file = Scenarios[i].name; @@ -199,7 +200,6 @@ void slurp_until_matching_bracket(istream& in, ostream& out) { :(before "End Test Runs") if (argc > 2 && is_equal(argv[1], "test") && file_exists(argv[2])) { Scenarios.clear(); // ignore core.mu - assert(Next_recipe_number < 1000); // don't load into test space for (int i = 2; i < argc; ++i) { load(argv[i]); } |