// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1366 globals integer array Person_nextFree integer Person_firstFree=0 integer Person_maxIndex=0 integer array Person_typeId string array Person_name endglobals native testFail takes string msg returns nothing native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function init_test takes nothing returns nothing local string n = "peq" local integer p local integer this local integer this_1 local integer this_2 local string n_1 local integer this_3 local string test_Person_getName_result local integer this_4 local integer this_5 local string n_2 local integer this_6 local string n_3 local integer this_7 local string test_Person_getName_result_1 local integer this_8 if Person_firstFree == 0 then if Person_maxIndex < 32768 then set Person_maxIndex = Person_maxIndex + 1 set this_1 = Person_maxIndex set Person_typeId[this_1] = 1 else call error("Out of memory: Could not create Person.") set this_1 = 0 endif else set Person_firstFree = Person_firstFree - 1 set this_1 = Person_nextFree[Person_firstFree] set Person_typeId[this_1] = 1 endif set this = this_1 set this_2 = this set n_1 = n set Person_name[this_2] = n_1 set p = this set this_3 = p if Person_typeId[this_3] == 0 then if this_3 == 0 then call error("Nullpointer exception when calling Person.getName") else call error("Called Person.getName on invalid object.") endif endif set this_4 = this_3 set test_Person_getName_result = Person_name[this_4] if test_Person_getName_result != "peq" then call testFail("name != peq") else set this_5 = p set n_2 = "Frotty" if Person_typeId[this_5] == 0 then if this_5 == 0 then call error("Nullpointer exception when calling Person.setName") else call error("Called Person.setName on invalid object.") endif endif set this_6 = this_5 set n_3 = n_2 set Person_name[this_6] = n_3 set this_7 = p if Person_typeId[this_7] == 0 then if this_7 == 0 then call error("Nullpointer exception when calling Person.getName") else call error("Called Person.getName on invalid object.") endif endif set this_8 = this_7 set test_Person_getName_result_1 = Person_name[this_8] if test_Person_getName_result_1 == "Frotty" then call testSuccess() else call testFail("name != Frotty.") endif endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction