array Person_nextFree540 integer Person_firstFree639 integer Person_maxIndex120 array Person_typeId105 array Person_name513 integer Person_firstFree639 = 0 integer Person_maxIndex120 = 0 function initGlobals272() { } function main112() { initGlobals272(); init_test130(); } function config179() { } function init_test130() { local integer p195 p_195 = new_Person961("peq"); if (dispatch_Person_test_Person_getName769(p_195) != "peq") { testFail968("name != peq"); } else { dispatch_Person_test_Person_setName132(p_195, "Frotty"); if (dispatch_Person_test_Person_getName769(p_195) == "Frotty") { testSuccess201(); } else { testFail968("name != Frotty."); }; }; } IS_NATIVE function testFail968(string msg111) { } IS_NATIVE function testSuccess201() { } function Person_setName139(integer this625, string n671) { Person_name_513[this_625] = n_671; } function Person_getName336(integer this147) returns string { return Person_name_513[this_147]; } function Person_init448(integer this577) { } function new_Person961(string n879) returns integer { local integer this831 this_831 = alloc_Person117(); construct_Person179(this_831, n_879); return this_831; } function construct_Person179(integer this677, string n146) { Person_init448(this_677); Person_name_513[this_677] = n_146; } function alloc_Person117() returns integer { local integer this114 if (Person_firstFree_639 == 0) { if (Person_maxIndex_120 < 32768) { Person_maxIndex_120 = (Person_maxIndex_120 + 1); this_114 = Person_maxIndex_120; Person_typeId_105[this_114] = 1; } else { error934("Out of memory: Could not create Person."); this_114 = 0; }; } else { Person_firstFree_639 = (Person_firstFree_639 - 1); this_114 = Person_nextFree_540[Person_firstFree_639]; Person_typeId_105[this_114] = 1; }; return this_114; } function error934(string msg184) { $debugPrint663((msg_184 + (" " + #getStackTrace()))); } function dispatch_Person_test_Person_setName132(integer this251, string n177) { if (Person_typeId_105[this_251] == 0) { if (this_251 == 0) { error934("Nullpointer exception when calling Person.setName"); } else { error934("Called Person.setName on invalid object."); }; } else { }; Person_setName139(this_251, n_177); } function dispatch_Person_test_Person_getName769(integer this790) returns string { if (Person_typeId_105[this_790] == 0) { if (this_790 == 0) { error934("Nullpointer exception when calling Person.getName"); } else { error934("Called Person.getName on invalid object."); }; } else { }; return Person_getName336(this_790); }