array Person_nextFree175 integer Person_firstFree265 integer Person_maxIndex116 array Person_typeId716 array Person_name168 integer Person_firstFree265 = 0 integer Person_maxIndex116 = 0 function initGlobals804() { } function main910() { initGlobals804(); init_test162(); } function config237() { } function init_test162() { local integer p116 p_116 = new_Person340("peq"); if (dispatch_Person_test_Person_getName184(p_116) != "peq") { testFail624("name != peq"); } else { dispatch_Person_test_Person_setName170(p_116, "Frotty"); if (dispatch_Person_test_Person_getName184(p_116) == "Frotty") { testSuccess173(); } else { testFail624("name != Frotty."); }; }; } IS_NATIVE function testFail624(string msg470) { } IS_NATIVE function testSuccess173() { } function Person_setName801(integer this119, string n810) { Person_name_168[this_119] = n_810; } function Person_getName194(integer this214) returns string { return Person_name_168[this_214]; } function Person_init392(integer this855) { } function new_Person340(string n812) returns integer { local integer this202 this_202 = alloc_Person146(); construct_Person819(this_202, n_812); return this_202; } function construct_Person819(integer this653, string n168) { Person_init392(this_653); Person_name_168[this_653] = n_168; } function alloc_Person146() returns integer { local integer this187 if (Person_firstFree_265 == 0) { if (Person_maxIndex_116 < 32768) { Person_maxIndex_116 = (Person_maxIndex_116 + 1); this_187 = Person_maxIndex_116; Person_typeId_716[this_187] = 1; } else { error137("Out of memory: Could not create Person."); this_187 = 0; }; } else { Person_firstFree_265 = (Person_firstFree_265 - 1); this_187 = Person_nextFree_175[Person_firstFree_265]; Person_typeId_716[this_187] = 1; }; return this_187; } function error137(string msg194) { $debugPrint182((msg_194 + (" " + #getStackTrace()))); } function dispatch_Person_test_Person_setName170(integer this193, string n109) { if (Person_typeId_716[this_193] == 0) { if (this_193 == 0) { error137("Nullpointer exception when calling Person.setName"); } else { error137("Called Person.setName on invalid object."); }; } else { }; Person_setName801(this_193, n_109); } function dispatch_Person_test_Person_getName184(integer this842) returns string { if (Person_typeId_716[this_842] == 0) { if (this_842 == 0) { error137("Nullpointer exception when calling Person.getName"); } else { error137("Called Person.getName on invalid object."); }; } else { }; return Person_getName194(this_842); }