// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1367 globals integer Test_x=0 integer array LinkedList_nextFree integer LinkedList_firstFree=0 integer LinkedList_maxIndex=0 integer array LinkedList_typeId integer array LinkedList_t endglobals 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 new_LinkedList takes nothing returns integer local integer this local integer this_1 if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this_1 = LinkedList_maxIndex set LinkedList_typeId[this_1] = 1 else call error("Out of memory: Could not create LinkedList.") set this_1 = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this_1 = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this_1] = 1 endif set this = this_1 return this endfunction function asList_1 takes integer ts_0 returns integer local integer ll = new_LinkedList() local integer this = ll local integer t = ts_0 local integer this_1 local integer t_1 if LinkedList_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling LinkedList.add") else call error("Called LinkedList.add on invalid object.") endif endif set this_1 = this set t_1 = t set LinkedList_t[this_1] = t_1 return ll endfunction function init_Test takes nothing returns nothing local integer ts_0 = 42 local integer ll = new_LinkedList() local integer this_2 = ll local integer t = ts_0 local integer this local integer Test_LinkedList_getFirst_result local integer this_1 local integer this_3 local integer t_1 local integer this_4 local integer Test_LinkedList_getFirst_result_1 local integer this_5 if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call error("Nullpointer exception when calling LinkedList.add") else call error("Called LinkedList.add on invalid object.") endif endif set this_3 = this_2 set t_1 = t set LinkedList_t[this_3] = t_1 set this = asList_1(ll) if LinkedList_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling LinkedList.getFirst") else call error("Called LinkedList.getFirst on invalid object.") endif endif set this_1 = this set Test_LinkedList_getFirst_result = LinkedList_t[this_1] set Test_x = Test_LinkedList_getFirst_result set this_4 = Test_x if LinkedList_typeId[this_4] == 0 then if this_4 == 0 then call error("Nullpointer exception when calling LinkedList.getFirst") else call error("Called LinkedList.getFirst on invalid object.") endif endif set this_5 = this_4 set Test_LinkedList_getFirst_result_1 = LinkedList_t[this_5] if Test_LinkedList_getFirst_result_1 == 42 then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_Test() endfunction function config takes nothing returns nothing endfunction