array Person_nextFree172 integer Person_firstFree804 integer Person_maxIndex155 array Person_typeId218 array Person_name159 integer Person_firstFree804 = 0 integer Person_maxIndex155 = 0 function initGlobals140() { } function main134() { initGlobals140(); init_test288(); } function config200() { } function init_test288() { local integer p142 p_142 = new_Person109("peq"); if (dispatch_Person_test_Person_getName143(p_142) != "peq") { testFail441("name != peq"); } else { dispatch_Person_test_Person_setName854(p_142, "Frotty"); if (dispatch_Person_test_Person_getName143(p_142) == "Frotty") { testSuccess116(); } else { testFail441("name != Frotty."); }; }; } IS_NATIVE function testFail441(string msg486) { } IS_NATIVE function testSuccess116() { } function Person_setName220(integer this305, string n124) { Person_name_159[this_305] = n_124; } function Person_getName402(integer this151) returns string { return Person_name_159[this_151]; } function Person_init202(integer this181) { } function new_Person109(string n132) returns integer { local integer this279 this_279 = alloc_Person178(); construct_Person155(this_279, n_132); return this_279; } function construct_Person155(integer this375, string n270) { Person_init202(this_375); Person_name_159[this_375] = n_270; } function alloc_Person178() returns integer { local integer this121 if (Person_firstFree_804 == 0) { if (Person_maxIndex_155 < 32768) { Person_maxIndex_155 = (Person_maxIndex_155 + 1); this_121 = Person_maxIndex_155; Person_typeId_218[this_121] = 1; } else { error116("Out of memory: Could not create Person."); this_121 = 0; }; } else { Person_firstFree_804 = (Person_firstFree_804 - 1); this_121 = Person_nextFree_172[Person_firstFree_804]; Person_typeId_218[this_121] = 1; }; return this_121; } function error116(string msg147) { $debugPrint963((msg_147 + (" " + #getStackTrace()))); } function dispatch_Person_test_Person_setName854(integer this154, string n198) { if (Person_typeId_218[this_154] == 0) { if (this_154 == 0) { error116("Nullpointer exception when calling Person.setName"); } else { error116("Called Person.setName on invalid object."); }; } else { }; Person_setName220(this_154, n_198); } function dispatch_Person_test_Person_getName143(integer this156) returns string { if (Person_typeId_218[this_156] == 0) { if (this_156 == 0) { error116("Nullpointer exception when calling Person.getName"); } else { error116("Called Person.getName on invalid object."); }; } else { }; return Person_getName402(this_156); }