// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer array Bla_nextFree integer Bla_firstFree=0 integer Bla_maxIndex=0 integer array Bla_typeId integer array Bla_i integer array Bla_j endglobals native testFail takes string msg returns nothing native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function Bla_getI takes integer this returns integer return Bla_i[this] endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function dispatch_Bla_test_Bla_getI takes integer this returns integer if Bla_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Bla.getI") else call error("Called Bla.getI on invalid object.") endif endif return Bla_getI(this) endfunction function Bla_getJ takes integer this returns integer return Bla_j[this] endfunction function dispatch_Bla_test_Bla_getJ takes integer this returns integer if Bla_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Bla.getJ") else call error("Called Bla.getJ on invalid object.") endif endif return Bla_getJ(this) endfunction function Bla_getK takes integer this returns integer return 36 endfunction function dispatch_Bla_test_Bla_getK takes integer this returns integer if Bla_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Bla.getK") else call error("Called Bla.getK on invalid object.") endif endif return Bla_getK(this) endfunction function alloc_Bla takes nothing returns integer local integer this if Bla_firstFree == 0 then if Bla_maxIndex < 32768 then set Bla_maxIndex = Bla_maxIndex + 1 set this = Bla_maxIndex set Bla_typeId[this] = 1 else call error("Out of memory: Could not create Bla.") set this = 0 endif else set Bla_firstFree = Bla_firstFree - 1 set this = Bla_nextFree[Bla_firstFree] set Bla_typeId[this] = 1 endif return this endfunction function Bla_init takes integer this returns nothing set Bla_i[this] = 13 set Bla_j[this] = 27 endfunction function construct_Bla takes integer this, integer j returns nothing call Bla_init(this) set Bla_j[this] = j endfunction function new_Bla takes integer j returns integer local integer this = alloc_Bla() call construct_Bla(this, j) return this endfunction function init_test takes nothing returns nothing local integer b = new_Bla(14) if dispatch_Bla_test_Bla_getI(b) != 13 then call testFail("i") elseif dispatch_Bla_test_Bla_getJ(b) != 14 then call testFail("j") elseif dispatch_Bla_test_Bla_getK(b) != 36 then call testFail("k") else call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction