array Person_nextFree130 integer Person_firstFree510 integer Person_maxIndex836 array Person_typeId171 array Person_name374 integer Person_firstFree510 = 0 integer Person_maxIndex836 = 0 function initGlobals904() { Person_firstFree_510 = 0; Person_maxIndex_836 = 0; } function main125() { initGlobals904(); init_test241(); } function config925() { } function init_test241() { local integer p112 p_112 = new_Person294("peq"); if (dispatch_Person_test_Person_getName920(p_112) != "peq") { testFail191("name != peq"); } else { dispatch_Person_test_Person_setName159(p_112, "Frotty"); if (dispatch_Person_test_Person_getName920(p_112) == "Frotty") { testSuccess735(); } else { testFail191("name != Frotty."); }; }; } IS_NATIVE function testFail191(string msg192) { } IS_NATIVE function testSuccess735() { } function Person_setName128(integer this731, string n129) { Person_name_374[this_731] = n_129; } function Person_getName269(integer this196) returns string { return Person_name_374[this_196]; } function Person_init127(integer this262) { } function new_Person294(string n135) returns integer { local integer this170 this_170 = alloc_Person215(); construct_Person153(this_170, n_135); return this_170; } function construct_Person153(integer this866, string n781) { Person_init127(this_866); Person_name_374[this_866] = n_781; } function alloc_Person215() returns integer { local integer this185 if (Person_firstFree_510 == 0) { if (Person_maxIndex_836 < 32768) { Person_maxIndex_836 = (Person_maxIndex_836 + 1); this_185 = Person_maxIndex_836; Person_typeId_171[this_185] = 1; } else { error122("Out of memory: Could not create Person."); this_185 = 0; }; } else { Person_firstFree_510 = (Person_firstFree_510 - 1); this_185 = Person_nextFree_130[Person_firstFree_510]; Person_typeId_171[this_185] = 1; }; return this_185; } function error122(string msg875) { $debugPrint178((msg_875 + (" " + #getStackTrace()))); } function dispatch_Person_test_Person_setName159(integer this511, string n298) { if (Person_typeId_171[this_511] == 0) { if (this_511 == 0) { error122("Nullpointer exception when calling Person.setName"); } else { error122("Called Person.setName on invalid object."); }; } else { }; Person_setName128(this_511, n_298); } function dispatch_Person_test_Person_getName920(integer this109) returns string { local string test_Person_getName_result636 if (Person_typeId_171[this_109] == 0) { if (this_109 == 0) { error122("Nullpointer exception when calling Person.getName"); } else { error122("Called Person.getName on invalid object."); }; } else { }; test_Person_getName_result_636 = Person_getName269(this_109); return test_Person_getName_result_636; }