// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1367 globals integer array CounterImpl_nextFree integer CounterImpl_firstFree=0 integer CounterImpl_maxIndex=0 integer array CounterImpl_typeId integer array CounterImpl_Counter_count 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 new_CounterImpl takes nothing returns integer local integer this local integer this_1 local integer this_2 local integer this_3 if CounterImpl_firstFree == 0 then if CounterImpl_maxIndex < 32768 then set CounterImpl_maxIndex = CounterImpl_maxIndex + 1 set this_1 = CounterImpl_maxIndex set CounterImpl_typeId[this_1] = 1 else call error("Out of memory: Could not create CounterImpl.") set this_1 = 0 endif else set CounterImpl_firstFree = CounterImpl_firstFree - 1 set this_1 = CounterImpl_nextFree[CounterImpl_firstFree] set CounterImpl_typeId[this_1] = 1 endif set this = this_1 set this_2 = this set this_3 = this_2 set CounterImpl_Counter_count[this_3] = 0 return this endfunction function init_test takes nothing returns nothing local integer c = new_CounterImpl() local integer this = c local integer this_1 local integer this_2 local integer this_3 local integer this_4 local integer test_CounterImpl_Counter_getCounter_result local integer this_5 if CounterImpl_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling CounterImpl.incCounter") else call error("Called CounterImpl.incCounter on invalid object.") endif endif set this_1 = this set CounterImpl_Counter_count[this_1] = CounterImpl_Counter_count[this_1] + 1 set this_2 = c if CounterImpl_typeId[this_2] == 0 then if this_2 == 0 then call error("Nullpointer exception when calling CounterImpl.incCounter") else call error("Called CounterImpl.incCounter on invalid object.") endif endif set this_3 = this_2 set CounterImpl_Counter_count[this_3] = CounterImpl_Counter_count[this_3] + 1 set this_4 = c if CounterImpl_typeId[this_4] == 0 then if this_4 == 0 then call error("Nullpointer exception when calling CounterImpl.getCounter") else call error("Called CounterImpl.getCounter on invalid object.") endif endif set this_5 = this_4 set test_CounterImpl_Counter_getCounter_result = CounterImpl_Counter_count[this_5] if test_CounterImpl_Counter_getCounter_result == 2 then call testSuccess() else call testFail("defect in equality if") endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction