array Person_nextFree323 integer Person_firstFree105 integer Person_maxIndex299 array Person_typeId255 array Person_name485 integer Person_firstFree105 = 0 integer Person_maxIndex299 = 0 function initGlobals167() { } function main895() { initGlobals167(); init_test884(); } function config870() { } function init_test884() { local integer p292 p_292 = new_Person886("peq"); if (dispatch_Person_test_Person_getName177(p_292) != "peq") { testFail116("name != peq"); } else { dispatch_Person_test_Person_setName183(p_292, "Frotty"); if (dispatch_Person_test_Person_getName177(p_292) == "Frotty") { testSuccess138(); } else { testFail116("name != Frotty."); }; }; } IS_NATIVE function testFail116(string msg104) { } IS_NATIVE function testSuccess138() { } function Person_setName132(integer this332, string n204) { Person_name_485[this_332] = n_204; } function Person_getName826(integer this130) returns string { return Person_name_485[this_130]; } function Person_init114(integer this163) { } function new_Person886(string n268) returns integer { local integer this178 this_178 = alloc_Person796(); construct_Person857(this_178, n_268); return this_178; } function construct_Person857(integer this267, string n716) { Person_init114(this_267); Person_name_485[this_267] = n_716; } function alloc_Person796() returns integer { local integer this749 if (Person_firstFree_105 == 0) { if (Person_maxIndex_299 < 32768) { Person_maxIndex_299 = (Person_maxIndex_299 + 1); this_749 = Person_maxIndex_299; Person_typeId_255[this_749] = 1; } else { error325("Out of memory: Could not create Person."); this_749 = 0; }; } else { Person_firstFree_105 = (Person_firstFree_105 - 1); this_749 = Person_nextFree_323[Person_firstFree_105]; Person_typeId_255[this_749] = 1; }; return this_749; } function error325(string msg126) { $debugPrint114((msg_126 + (" " + #getStackTrace()))); } function dispatch_Person_test_Person_setName183(integer this210, string n750) { if (Person_typeId_255[this_210] == 0) { if (this_210 == 0) { error325("Nullpointer exception when calling Person.setName"); } else { error325("Called Person.setName on invalid object."); }; } else { }; Person_setName132(this_210, n_750); } function dispatch_Person_test_Person_getName177(integer this129) returns string { if (Person_typeId_255[this_129] == 0) { if (this_129 == 0) { error325("Nullpointer exception when calling Person.getName"); } else { error325("Called Person.getName on invalid object."); }; } else { }; return Person_getName826(this_129); }