// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1366 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 integer wurst_stack_depth=0 string array wurst_stack endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function error takes string msg, string w__wurst_stackPos returns nothing local integer stacktraceIndex local integer stacktraceLimit set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set w__wurst_stackPos = "" set stacktraceIndex = wurst_stack_depth set stacktraceLimit = 0 loop set stacktraceIndex = stacktraceIndex - 1 set stacktraceLimit = stacktraceLimit + 1 exitwhen stacktraceLimit > 20 or stacktraceIndex < 0 set w__wurst_stackPos = w__wurst_stackPos + "\n " + wurst_stack[stacktraceIndex] endloop call BJDebugMsg(msg + "\n" + w__wurst_stackPos) set wurst_stack_depth = wurst_stack_depth - 1 endfunction function new_LinkedList takes string w__wurst_stackPos returns integer local integer this set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set wurst_stack[wurst_stack_depth] = "when calling alloc_LinkedList in nestedList, line 3" set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this = LinkedList_maxIndex set LinkedList_typeId[this] = 1 else call error("Out of memory: Could not create LinkedList.", "when calling error in nestedList, line 3") set this = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this] = 1 endif set wurst_stack_depth = wurst_stack_depth - 1 - 1 return this endfunction function init_Test takes string w__wurst_stackPos returns nothing local integer Test_LinkedList_getFirst_result local integer ll local integer ll_1 set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set wurst_stack[wurst_stack_depth] = "when calling asList in nestedList, line 14" set wurst_stack_depth = wurst_stack_depth + 1 set ll_1 = new_LinkedList("when calling new_LinkedList in nestedList, line 10") set wurst_stack[wurst_stack_depth] = "when calling add in nestedList, line 12" set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_typeId[ll_1] == 0 then if ll_1 == 0 then call error("Nullpointer exception when calling LinkedList.add", "when calling error in nestedList, line 5") else call error("Called LinkedList.add on invalid object.", "when calling error in nestedList, line 5") endif endif set LinkedList_t[ll_1] = 42 set wurst_stack_depth = wurst_stack_depth - 1 - 1 set wurst_stack[wurst_stack_depth] = "when calling asList in nestedList, line 14" set wurst_stack_depth = wurst_stack_depth + 1 set ll = new_LinkedList("when calling new_LinkedList in nestedList, line 10") set wurst_stack[wurst_stack_depth] = "when calling add in nestedList, line 12" set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_typeId[ll] == 0 then if ll == 0 then call error("Nullpointer exception when calling LinkedList.add", "when calling error in nestedList, line 5") else call error("Called LinkedList.add on invalid object.", "when calling error in nestedList, line 5") endif endif set LinkedList_t[ll] = ll_1 set wurst_stack_depth = wurst_stack_depth - 1 - 1 set wurst_stack[wurst_stack_depth] = "when calling getFirst in nestedList, line 14" set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_typeId[ll] == 0 then if ll == 0 then call error("Nullpointer exception when calling LinkedList.getFirst", "when calling error in nestedList, line 7") else call error("Called LinkedList.getFirst on invalid object.", "when calling error in nestedList, line 7") endif endif set Test_LinkedList_getFirst_result = LinkedList_t[ll] set wurst_stack_depth = wurst_stack_depth - 1 set Test_x = Test_LinkedList_getFirst_result set ll_1 = Test_x set wurst_stack[wurst_stack_depth] = "when calling getFirst in nestedList, line 16" set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_typeId[ll_1] == 0 then if ll_1 == 0 then call error("Nullpointer exception when calling LinkedList.getFirst", "when calling error in nestedList, line 7") else call error("Called LinkedList.getFirst on invalid object.", "when calling error in nestedList, line 7") endif endif set Test_LinkedList_getFirst_result = LinkedList_t[ll_1] set wurst_stack_depth = wurst_stack_depth - 1 if Test_LinkedList_getFirst_result == 42 then call testSuccess() endif set wurst_stack_depth = wurst_stack_depth - 1 endfunction function main takes nothing returns nothing call initGlobals() call init_Test("when calling init_Test in nestedList, line 1") endfunction function config takes nothing returns nothing endfunction