3966
This commit is contained in:
parent
6573fe1f1a
commit
ec99eb7a2a
|
@ -132,5 +132,5 @@ int main(int argc, char* argv[]) {
|
|||
//: end.
|
||||
:(code)
|
||||
void reset() {
|
||||
// End Setup
|
||||
// End Reset
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ bool Passed = true; // set this to false inside any test to indicate failure
|
|||
return; /* Currently we stop at the very first failure. */ \
|
||||
}
|
||||
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Passed = true;
|
||||
|
||||
:(before "End Commandline Parsing")
|
||||
|
|
|
@ -80,7 +80,7 @@ struct trace_line {
|
|||
bool Hide_errors = false;
|
||||
bool Dump_trace = false;
|
||||
string Dump_label = "";
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Hide_errors = false;
|
||||
Dump_trace = false;
|
||||
Dump_label = "";
|
||||
|
|
6
010vm.cc
6
010vm.cc
|
@ -108,7 +108,7 @@ type_tree::type_tree(string name) :atom(true), name(name), value(get(Type_ordina
|
|||
:(before "End Globals")
|
||||
// Locations refer to a common 'memory'. Each location can store a number.
|
||||
map<int, double> Memory;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Memory.clear();
|
||||
|
||||
:(after "Types")
|
||||
|
@ -214,7 +214,7 @@ put(Recipe_ordinal, "main", Next_recipe_ordinal++);
|
|||
// End Load Recipes
|
||||
:(before "End Commandline Parsing")
|
||||
assert(Next_recipe_ordinal < 1000); // recipes being tested didn't overflow into test space
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Next_recipe_ordinal = 1000; // consistent new numbers for each test
|
||||
|
||||
//: One final detail: tests can modify our global tables of recipes and types,
|
||||
|
@ -227,7 +227,7 @@ map<string, type_ordinal> Type_ordinal_snapshot;
|
|||
map<type_ordinal, type_info> Type_snapshot;
|
||||
:(before "End One-time Setup")
|
||||
save_snapshots();
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
restore_snapshots();
|
||||
|
||||
:(code)
|
||||
|
|
|
@ -372,7 +372,7 @@ def main[
|
|||
//: we'll want to disable the errors.
|
||||
:(before "End Globals")
|
||||
bool Disable_redefine_checks = false;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Disable_redefine_checks = false;
|
||||
:(code)
|
||||
bool should_check_for_redefine(const string& recipe_name) {
|
||||
|
|
|
@ -48,7 +48,7 @@ struct routine {
|
|||
|
||||
:(before "End Globals")
|
||||
routine* Current_routine = NULL;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Current_routine = NULL;
|
||||
|
||||
:(code)
|
||||
|
|
|
@ -770,7 +770,7 @@ void expand_type_abbreviations_in_containers(unused const recipe_ordinal r) {
|
|||
|
||||
//: ensure scenarios are consistent by always starting new container
|
||||
//: declarations at the same type number
|
||||
:(before "End Setup") //: for tests
|
||||
:(before "End Reset") //: for tests
|
||||
Next_type_ordinal = 1000;
|
||||
:(before "End Test Run Initialization")
|
||||
assert(Next_type_ordinal < 1000);
|
||||
|
|
|
@ -293,7 +293,7 @@ void transform_new_to_allocate(const recipe_ordinal r) {
|
|||
extern const int Reserved_for_tests = 1000;
|
||||
int Memory_allocated_until = Reserved_for_tests;
|
||||
int Initial_memory_per_routine = 100000;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Memory_allocated_until = Reserved_for_tests;
|
||||
Initial_memory_per_routine = 100000;
|
||||
:(before "End routine Fields")
|
||||
|
@ -357,7 +357,7 @@ int allocate(int size) {
|
|||
//? int Num_alloc = 0;
|
||||
//? int Total_free = 0;
|
||||
//? int Num_free = 0;
|
||||
//? :(before "End Setup")
|
||||
//? :(before "End Reset")
|
||||
//? if (!Memory.empty()) {
|
||||
//? cerr << Total_alloc << "/" << Num_alloc
|
||||
//? << " vs " << Total_free << "/" << Num_free << '\n';
|
||||
|
|
|
@ -365,7 +365,7 @@ def main [
|
|||
|
||||
:(before "End Globals")
|
||||
bool Scenario_testing_scenario = false;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Scenario_testing_scenario = false;
|
||||
|
||||
:(scenario memory_check)
|
||||
|
|
|
@ -34,7 +34,7 @@ $mem: 3
|
|||
:(before "End Globals")
|
||||
map<string /*label*/, recipe> Before_fragments, After_fragments;
|
||||
set<string /*label*/> Fragments_used;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Before_fragments.clear();
|
||||
After_fragments.clear();
|
||||
Fragments_used.clear();
|
||||
|
|
|
@ -30,5 +30,5 @@ case MAKE_RANDOM_NONDETERMINISTIC: {
|
|||
}
|
||||
|
||||
// undo non-determinism in later tests
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
srand(0);
|
||||
|
|
|
@ -50,7 +50,7 @@ state = RUNNING;
|
|||
:(before "End Globals")
|
||||
vector<routine*> Routines;
|
||||
int Current_routine_index = 0;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Scheduling_interval = 500;
|
||||
for (int i = 0; i < SIZE(Routines); ++i)
|
||||
delete Routines.at(i);
|
||||
|
@ -144,7 +144,7 @@ void run_main(int argc, char* argv[]) {
|
|||
int id;
|
||||
:(before "End Globals")
|
||||
int Next_routine_id = 1;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Next_routine_id = 1;
|
||||
:(before "End routine Constructor")
|
||||
id = Next_routine_id;
|
||||
|
|
|
@ -140,7 +140,7 @@ $error: 0
|
|||
:(before "End Globals")
|
||||
extern const int Max_variables_in_scenarios = Reserved_for_tests-100;
|
||||
int Next_predefined_global_for_scenarios = Max_variables_in_scenarios;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
assert(Next_predefined_global_for_scenarios < Reserved_for_tests);
|
||||
|
||||
:(before "End Globals")
|
||||
|
|
|
@ -77,7 +77,7 @@ case RUN_SANDBOXED: {
|
|||
bool Track_most_recent_products = false;
|
||||
int Call_depth_to_track_most_recent_products_at = 0;
|
||||
string Most_recent_products;
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
Track_most_recent_products = false;
|
||||
Call_depth_to_track_most_recent_products_at = 0;
|
||||
Most_recent_products = "";
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//: Location 0 - unused (since it can help uncover bugs)
|
||||
//: Locations 1-899 - reserved for tests
|
||||
//: Locations 900-999 - reserved for predefined globals in Mu scenarios, like keyboard, screen, etc.
|
||||
:(before "End Setup")
|
||||
:(before "End Reset")
|
||||
assert(Max_variables_in_scenarios == 900);
|
||||
//: Locations 1000 ('Reserved_for_tests') onward - available to the allocator in chunks of size Initial_memory_per_routine.
|
||||
assert(Reserved_for_tests == 1000);
|
||||
|
|
Loading…
Reference in New Issue