array B_nextFree195 integer B_firstFree357 integer B_maxIndex116 array B_typeId131 integer B_firstFree357 = 0 integer B_maxIndex116 = 0 function initGlobals159() { } function main165() { initGlobals159(); init_test107(); } function config148() { } function init_test107() { local integer x1134 local integer x2153 local integer x3167 local integer x4438 x1_134 = new_C200(); x2_153 = new_D465(); x3_167 = new_C200(); x4_438 = new_D465(); if (dispatch_A_test_A_foo135(x1_134) != 1) { testFail125("1"); } else { }; if (dispatch_A_test_A_foo135(x2_153) != 2) { testFail125("2"); } else { }; if (dispatch_B_test_B_bar108(x3_167) != 3) { testFail125("3"); } else { }; if (dispatch_B_test_B_bar108(x4_438) != 4) { testFail125("4"); } else { }; testSuccess684(); } IS_NATIVE function testFail125(string s183) { } IS_NATIVE function testSuccess684() { } function new_C200() returns integer { local integer this198 if (B_firstFree_357 == 0) { if (B_maxIndex_116 < 32768) { B_maxIndex_116 = (B_maxIndex_116 + 1); this_198 = B_maxIndex_116; B_typeId_131[this_198] = 2; } else { error165("Out of memory: Could not create C."); this_198 = 0; }; } else { B_firstFree_357 = (B_firstFree_357 - 1); this_198 = B_nextFree_195[B_firstFree_357]; B_typeId_131[this_198] = 2; }; return this_198; } function new_D465() returns integer { local integer this137 if (B_firstFree_357 == 0) { if (B_maxIndex_116 < 32768) { B_maxIndex_116 = (B_maxIndex_116 + 1); this_137 = B_maxIndex_116; B_typeId_131[this_137] = 3; } else { error165("Out of memory: Could not create D."); this_137 = 0; }; } else { B_firstFree_357 = (B_firstFree_357 - 1); this_137 = B_nextFree_195[B_firstFree_357]; B_typeId_131[this_137] = 3; }; return this_137; } function error165(string msg932) { $debugPrint181((msg_932 + (" " + #getStackTrace()))); } function dispatch_A_test_A_foo135(integer this111) returns integer { if (B_typeId_131[this_111] == 0) { if (this_111 == 0) { error165("Nullpointer exception when calling A.foo"); } else { error165("Called A.foo on invalid object."); }; } else { }; if (B_typeId_131[this_111] <= 2) { this_111 = 1; } else { this_111 = 2; }; return this_111; } function dispatch_B_test_B_bar108(integer this352) returns integer { if (B_typeId_131[this_352] == 0) { if (this_352 == 0) { error165("Nullpointer exception when calling B.bar"); } else { error165("Called B.bar on invalid object."); }; } else { }; if (B_typeId_131[this_352] <= 2) { this_352 = 3; } else { this_352 = 4; }; return this_352; }