array Person_nextFree980 integer Person_firstFree377 integer Person_maxIndex201 array Person_typeId109 array Person_name197 integer Person_firstFree377 = 0 integer Person_maxIndex201 = 0 function initGlobals462() { Person_firstFree_377 = 0; Person_maxIndex_201 = 0; } function main192() { initGlobals462(); init_test142(); } function config127() { } function init_test142() { local integer p138 p_138 = new_Person606("peq"); if (dispatch_Person_test_Person_getName131(p_138) != "peq") { testFail205("name != peq"); } else { dispatch_Person_test_Person_setName826(p_138, "Frotty"); if (dispatch_Person_test_Person_getName131(p_138) == "Frotty") { testSuccess294(); } else { testFail205("name != Frotty."); }; }; } IS_NATIVE function testFail205(string msg159) { } IS_NATIVE function testSuccess294() { } function Person_setName199(integer this382, string n182) { Person_name_197[this_382] = n_182; } function Person_getName169(integer this101) returns string { return Person_name_197[this_101]; } function Person_init550(integer this127) { } function new_Person606(string n496) returns integer { local integer this503 this_503 = alloc_Person129(); construct_Person268(this_503, n_496); return this_503; } function construct_Person268(integer this339, string n128) { Person_init550(this_339); Person_name_197[this_339] = n_128; } function alloc_Person129() returns integer { local integer this140 if (Person_firstFree_377 == 0) { if (Person_maxIndex_201 < 32768) { Person_maxIndex_201 = (Person_maxIndex_201 + 1); this_140 = Person_maxIndex_201; Person_typeId_109[this_140] = 1; } else { error178("Out of memory: Could not create Person."); this_140 = 0; }; } else { Person_firstFree_377 = (Person_firstFree_377 - 1); this_140 = Person_nextFree_980[Person_firstFree_377]; Person_typeId_109[this_140] = 1; }; return this_140; } function error178(string msg816) { $debugPrint374((msg_816 + (" " + #getStackTrace()))); } function dispatch_Person_test_Person_setName826(integer this206, string n919) { if (Person_typeId_109[this_206] == 0) { if (this_206 == 0) { error178("Nullpointer exception when calling Person.setName"); } else { error178("Called Person.setName on invalid object."); }; } else { }; Person_setName199(this_206, n_919); } function dispatch_Person_test_Person_getName131(integer this627) returns string { local string test_Person_getName_result500 if (Person_typeId_109[this_627] == 0) { if (this_627 == 0) { error178("Nullpointer exception when calling Person.getName"); } else { error178("Called Person.getName on invalid object."); }; } else { }; test_Person_getName_result_500 = Person_getName169(this_627); return test_Person_getName_result_500; }