tcalobj5.pp 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293
  1. {****************************************************************}
  2. { CODE GENERATOR TEST PROGRAM }
  3. { Copyright (c) 2002 Carl Eric Codere }
  4. {****************************************************************}
  5. { NODE TESTED : secondcalln() }
  6. {****************************************************************}
  7. { PRE-REQUISITES: secondload() }
  8. { secondassign() }
  9. { secondtypeconv() }
  10. { secondtryexcept() }
  11. {****************************************************************}
  12. { DEFINES: }
  13. { FPC = Target is FreePascal compiler }
  14. {****************************************************************}
  15. { REMARKS: This tests secondcalln(), genentrycode() and }
  16. { genexitcode() for standard object with the safecall }
  17. { calling convention. }
  18. { }
  19. {****************************************************************}
  20. program tcalobj5;
  21. {$STATIC ON}
  22. {$R+}
  23. const
  24. { should be defined depending on CPU target }
  25. {$ifdef cpu68k}
  26. BIG_INDEX = 8000;
  27. SMALL_INDEX = 13;
  28. {$else}
  29. BIG_INDEX = 33000;
  30. SMALL_INDEX = 13; { value should not be aligned! }
  31. {$endif}
  32. RESULT_U8BIT = $55;
  33. RESULT_U16BIT = 2*RESULT_U8BIT;
  34. RESULT_S32BIT = $500F0000;
  35. RESULT_S64BIT = $500F0000;
  36. RESULT_S32REAL = 1777.12;
  37. RESULT_S64REAL = 3444.24;
  38. RESULT_BOOL8BIT = 1;
  39. RESULT_BOOL16BIT = 1;
  40. RESULT_BOOL32BIT = 1;
  41. RESULT_PCHAR = 'Hello world';
  42. RESULT_BIGSTRING = 'Hello world';
  43. RESULT_SMALLSTRING = 'H';
  44. RESULT_CHAR = 'I';
  45. RESULT_BOOLEAN = TRUE;
  46. type
  47. tprocedure = procedure;
  48. tsmallrecord = packed record
  49. b: byte;
  50. w: word;
  51. end;
  52. tlargerecord = packed record
  53. b: array[1..BIG_INDEX] of byte;
  54. end;
  55. tsmallarray = packed array[1..SMALL_INDEX] of byte;
  56. tsmallsetenum =
  57. (A_A,A_B,A_C,A_D);
  58. tsmallset = set of tsmallsetenum;
  59. tlargeset = set of char;
  60. tsmallstring = string[2];
  61. var
  62. global_u8bit : byte;
  63. global_u16bit : word;
  64. global_s32bit : longint;
  65. global_s32real : single;
  66. global_s64real : double;
  67. global_ptr : pchar;
  68. global_proc : tprocedure;
  69. global_bigstring : shortstring;
  70. global_boolean : boolean;
  71. global_char : char;
  72. global_s64bit : int64;
  73. value_s64bit : int64;
  74. value_ansistring : ansistring;
  75. value_u8bit : byte;
  76. value_u16bit : word;
  77. value_s32bit : longint;
  78. value_s32real : single;
  79. value_s64real : double;
  80. value_proc : tprocedure;
  81. value_ptr : pchar;
  82. value_smallrec : tsmallrecord;
  83. value_largerec : tlargerecord;
  84. value_smallset : tsmallset;
  85. value_smallstring : tsmallstring;
  86. value_bigstring : shortstring;
  87. value_largeset : tlargeset;
  88. value_smallarray : tsmallarray;
  89. value_boolean : boolean;
  90. value_char : char;
  91. procedure fail;
  92. begin
  93. WriteLn('Failure.');
  94. halt(1);
  95. end;
  96. procedure clear_globals;
  97. begin
  98. global_u8bit := 0;
  99. global_u16bit := 0;
  100. global_s32bit := 0;
  101. global_s32real := 0.0;
  102. global_s64real := 0.0;
  103. global_ptr := nil;
  104. global_proc := nil;
  105. global_bigstring := '';
  106. global_boolean := false;
  107. global_char := #0;
  108. global_s64bit := 0;
  109. end;
  110. procedure clear_values;
  111. begin
  112. value_u8bit := 0;
  113. value_u16bit := 0;
  114. value_s32bit := 0;
  115. value_s32real := 0.0;
  116. value_s64real := 0.0;
  117. value_proc := nil;
  118. value_ptr := nil;
  119. fillchar(value_smallrec, sizeof(value_smallrec), #0);
  120. fillchar(value_largerec, sizeof(value_largerec), #0);
  121. value_smallset := [];
  122. value_smallstring := '';
  123. value_bigstring := '';
  124. value_largeset := [];
  125. fillchar(value_smallarray, sizeof(value_smallarray), #0);
  126. value_boolean := false;
  127. value_char:=#0;
  128. value_ansistring := '';
  129. value_s64bit := 0;
  130. end;
  131. function getu8: byte;
  132. begin
  133. getu8 := RESULT_U8BIT;
  134. end;
  135. type
  136. { object without vmt }
  137. pnovmtobject = ^tnovmtobject;
  138. tnovmtobject = object
  139. public
  140. object_bigstring : shortstring;
  141. object_u16bit : word;
  142. { no parameter testing }
  143. procedure method_public_none;safecall;
  144. procedure method_public_static_none; static;safecall;
  145. procedure method_call_private_none;safecall;
  146. procedure method_call_private_static_none; static;safecall;
  147. { simple value parameter testing }
  148. procedure method_public_u8(x : byte);safecall;
  149. procedure method_public_static_u8(x: byte); static;safecall;
  150. procedure method_call_private_u8(x: byte);safecall;
  151. procedure method_call_private_static_u8(x: byte); static;safecall;
  152. function func_array_mixed_nested(b: byte): tsmallarray;safecall;
  153. private
  154. procedure method_private_none;safecall;
  155. procedure method_private_static_none; static;safecall;
  156. function func_getu16bit : word;safecall;
  157. { simple value parameter testing }
  158. procedure method_private_u8(x: byte);safecall;
  159. procedure method_private_static_u8(x: byte); static;safecall;
  160. end;
  161. { object with vmt }
  162. pvmtobject = ^tvmtobject;
  163. tvmtobject = object
  164. public
  165. object_u8bit : byte;
  166. object_u16bit : word;
  167. object_bigstring : shortstring;
  168. object_s32bit : longint;
  169. object_s64bit : int64;
  170. constructor constructor_params_mixed(u8 :byte; u16: word;
  171. bigstring: shortstring; s32: longint; s64: int64);
  172. constructor constructor_init;
  173. destructor destructor_params_done;
  174. procedure method_normal_params_mixed(u8 :byte; u16: word;
  175. bigstring: shortstring; s32: longint; s64: int64);safecall;
  176. procedure method_virtual_params_mixed(u8 :byte; u16: word;
  177. bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  178. procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word;
  179. bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  180. procedure method_static_params_mixed(u8 :byte; u16: word;
  181. bigstring: shortstring; s32: longint; s64: int64);static;safecall;
  182. procedure method_normal_call_inherited_params_mixed(
  183. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  184. { virtual methods which call other methods }
  185. procedure method_virtual_call_static_params_mixed(
  186. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  187. procedure method_virtual_call_virtual_params_mixed(
  188. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  189. procedure method_virtual_call_overriden_params_mixed(
  190. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  191. procedure method_virtual_call_normal_params_mixed(
  192. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  193. procedure method_virtual_call_constructor_params_mixed(
  194. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  195. procedure method_virtual_call_inherited_params_mixed(
  196. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  197. end;
  198. pheritedvmtobject = ^theritedvmtobject;
  199. theritedvmtobject = object(tvmtobject)
  200. constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word;
  201. bigstring: shortstring; s32: longint; s64: int64);
  202. constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word;
  203. bigstring: shortstring; s32: longint; s64: int64);
  204. constructor constructor_params_mixed_call_static(u8 :byte; u16: word;
  205. bigstring: shortstring; s32: longint; s64: int64);
  206. constructor constructor_params_mixed_call_normal(u8 :byte; u16: word;
  207. bigstring: shortstring; s32: longint; s64: int64);
  208. constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word;
  209. bigstring: shortstring; s32: longint; s64: int64);
  210. procedure method_virtual_overriden_params_mixed(
  211. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  212. { normal methods which call other methods }
  213. procedure method_normal_call_static_params_mixed(
  214. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  215. procedure method_normal_call_virtual_params_mixed(
  216. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  217. procedure method_normal_call_overriden_params_mixed(
  218. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  219. procedure method_normal_call_normal_params_mixed(
  220. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  221. procedure method_normal_call_constructor_params_mixed(
  222. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  223. procedure method_normal_call_inherited_params_mixed(
  224. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  225. { virtual methods which call other methods }
  226. procedure method_virtual_call_inherited_params_mixed(
  227. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
  228. end;
  229. pfailvmtobject = ^tfailvmtobject;
  230. tfailvmtobject = object(tvmtobject)
  231. public
  232. constructor constructor_public_none;
  233. end;
  234. {**************************************************************************}
  235. { NO VMT OBJECT }
  236. {**************************************************************************}
  237. {****************** NO PARAMETERS ******************}
  238. procedure tnovmtobject.method_public_none;safecall;
  239. begin
  240. global_u8bit := RESULT_U8BIT;
  241. end;
  242. procedure tnovmtobject.method_public_static_none;safecall;
  243. begin
  244. global_u8bit := RESULT_U8BIT;
  245. end;
  246. procedure tnovmtobject.method_call_private_none;safecall;
  247. begin
  248. method_private_none;
  249. method_private_static_none;
  250. end;
  251. procedure tnovmtobject.method_call_private_static_none;safecall;
  252. begin
  253. method_private_static_none;
  254. end;
  255. procedure tnovmtobject.method_private_none;safecall;
  256. begin
  257. Inc(global_u16bit, RESULT_U8BIT);
  258. end;
  259. procedure tnovmtobject.method_private_static_none;safecall;
  260. begin
  261. Inc(global_u16bit, RESULT_U8BIT);
  262. end;
  263. {******************** PARAMETERS ******************}
  264. procedure tnovmtobject.method_public_u8(x : byte);safecall;
  265. begin
  266. global_u8bit := x;
  267. end;
  268. procedure tnovmtobject.method_public_static_u8(x: byte);safecall;
  269. begin
  270. global_u8bit := x;
  271. end;
  272. procedure tnovmtobject.method_call_private_u8(x: byte);safecall;
  273. begin
  274. method_private_static_u8(x);
  275. method_private_u8(x);
  276. end;
  277. procedure tnovmtobject. method_call_private_static_u8(x: byte);safecall;
  278. begin
  279. method_private_static_u8(x);
  280. end;
  281. procedure tnovmtobject.method_private_u8(x: byte);safecall;
  282. begin
  283. Inc(global_u16bit,x);
  284. end;
  285. procedure tnovmtobject.method_private_static_u8(x: byte);safecall;
  286. begin
  287. Inc(global_u16bit,x);
  288. end;
  289. function tnovmtobject.func_getu16bit : word;safecall;
  290. begin
  291. func_getu16bit := object_u16bit;
  292. end;
  293. {
  294. complex testing, nested field access, with parameters and
  295. comple return value.
  296. On exit : global_u8bit := x;
  297. global_u16bit := object_u16bit (from func_getu16bit);
  298. global_s32bit := RESULT_S32BIT
  299. global_bigstring := object_bigstring
  300. global_s64bit := x;
  301. }
  302. function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;safecall;
  303. procedure nested_one_proc(l: longint);
  304. begin
  305. global_u16bit := func_getu16bit;
  306. global_s32bit := l;
  307. end;
  308. procedure nested_two_proc(l : longint);
  309. begin
  310. global_s64bit := l;
  311. end;
  312. function nested_one_func(level1_b : byte; s: shortstring): byte;
  313. var
  314. s1 : shortstring;
  315. function nested_two_func(level2_b : byte; s :shortstring): byte;
  316. begin
  317. nested_two_func:=level2_b;
  318. global_bigstring := s;
  319. nested_one_proc(RESULT_S32BIT);
  320. end;
  321. begin
  322. s1:=s;
  323. nested_one_func := nested_two_func(level1_b,s1);
  324. nested_two_proc(level1_b);
  325. end;
  326. var
  327. local_b: byte;
  328. smallarray: tsmallarray;
  329. begin
  330. fillchar(smallarray, sizeof(smallarray), #0);
  331. smallarray[1] := RESULT_U8BIT;
  332. smallarray[SMALL_INDEX] := RESULT_U8BIT;
  333. func_array_mixed_nested := smallarray;
  334. local_b:=b;
  335. global_u8bit := nested_one_func(local_b, object_bigstring);
  336. end;
  337. {**************************************************************************}
  338. { FAILED OBJECT }
  339. {**************************************************************************}
  340. constructor tfailvmtobject.constructor_public_none;
  341. begin
  342. { this calls the constructor fail special keyword }
  343. fail;
  344. end;
  345. {**************************************************************************}
  346. { VMT OBJECT }
  347. {**************************************************************************}
  348. constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word;
  349. bigstring: shortstring; s32: longint; s64: int64);
  350. begin
  351. object_u8bit := u8;
  352. object_u16bit := u16;
  353. object_bigstring := bigstring;
  354. object_s32bit := s32;
  355. object_s64bit := s64;
  356. end;
  357. constructor tvmtobject.constructor_init;
  358. begin
  359. object_u8bit := 0;
  360. object_u16bit := 0;
  361. object_bigstring := '';
  362. object_s32bit := 0;
  363. object_s64bit := 0;
  364. end;
  365. destructor tvmtobject.destructor_params_done;
  366. begin
  367. object_u8bit := 0;
  368. object_u16bit := 0;
  369. object_bigstring := '';
  370. object_s32bit := 0;
  371. object_s64bit := 0;
  372. end;
  373. procedure tvmtobject.method_normal_params_mixed(
  374. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  375. begin
  376. object_u8bit := u8;
  377. object_u16bit := u16;
  378. object_bigstring := bigstring;
  379. object_s32bit := s32;
  380. object_s64bit := s64;
  381. end;
  382. procedure tvmtobject.method_virtual_params_mixed(
  383. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  384. begin
  385. object_u8bit := u8;
  386. object_u16bit := u16;
  387. object_bigstring := bigstring;
  388. object_s32bit := s32;
  389. object_s64bit := s64;
  390. end;
  391. { this one should be overriden }
  392. procedure tvmtobject.method_virtual_overriden_params_mixed(
  393. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  394. begin
  395. RunError(211);
  396. end;
  397. { can't access field of instances in static methods }
  398. procedure tvmtobject.method_static_params_mixed(
  399. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  400. begin
  401. global_u8bit := u8;
  402. global_u16bit := u16;
  403. global_bigstring := bigstring;
  404. global_s32bit := s32;
  405. global_s64bit := s64;
  406. end;
  407. procedure tvmtobject.method_normal_call_inherited_params_mixed(
  408. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  409. begin
  410. object_u8bit := u8;
  411. object_u16bit := u16;
  412. object_bigstring := bigstring;
  413. object_s32bit := s32;
  414. object_s64bit := s64;
  415. end;
  416. procedure tvmtobject.method_virtual_call_static_params_mixed(
  417. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  418. begin
  419. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  420. end;
  421. procedure tvmtobject.method_virtual_call_virtual_params_mixed(
  422. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  423. begin
  424. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  425. end;
  426. procedure tvmtobject.method_virtual_call_overriden_params_mixed(
  427. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  428. begin
  429. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  430. end;
  431. procedure tvmtobject.method_virtual_call_normal_params_mixed(
  432. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  433. begin
  434. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  435. end;
  436. procedure tvmtobject.method_virtual_call_constructor_params_mixed(
  437. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  438. begin
  439. constructor_params_mixed(u8, u16, bigstring, s32, s64);
  440. end;
  441. procedure tvmtobject.method_virtual_call_inherited_params_mixed(
  442. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  443. begin
  444. object_u8bit := u8;
  445. object_u16bit := u16;
  446. object_bigstring := bigstring;
  447. object_s32bit := s32;
  448. object_s64bit := s64;
  449. end;
  450. {**************************************************************************}
  451. { INHERITED VMT OBJECT }
  452. {**************************************************************************}
  453. constructor theritedvmtobject.constructor_params_mixed_call_virtual(
  454. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  455. begin
  456. object_u8bit := 0;
  457. object_u16bit := 0;
  458. object_bigstring := '';
  459. object_s32bit := 0;
  460. object_s64bit := 0;
  461. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  462. end;
  463. constructor theritedvmtobject.constructor_params_mixed_call_overriden(
  464. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  465. begin
  466. object_u8bit := 0;
  467. object_u16bit := 0;
  468. object_bigstring := '';
  469. object_s32bit := 0;
  470. object_s64bit := 0;
  471. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  472. end;
  473. constructor theritedvmtobject.constructor_params_mixed_call_static(
  474. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  475. begin
  476. object_u8bit := 0;
  477. object_u16bit := 0;
  478. object_bigstring := '';
  479. object_s32bit := 0;
  480. object_s64bit := 0;
  481. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  482. end;
  483. constructor theritedvmtobject.constructor_params_mixed_call_normal(
  484. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  485. begin
  486. object_u8bit := 0;
  487. object_u16bit := 0;
  488. object_bigstring := '';
  489. object_s32bit := 0;
  490. object_s64bit := 0;
  491. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  492. end;
  493. constructor theritedvmtobject.constructor_params_mixed_call_inherited
  494. (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  495. begin
  496. object_u8bit := 0;
  497. object_u16bit := 0;
  498. object_bigstring := '';
  499. object_s32bit := 0;
  500. object_s64bit := 0;
  501. inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
  502. end;
  503. { this one should be overriden }
  504. procedure theritedvmtobject.method_virtual_overriden_params_mixed(
  505. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  506. begin
  507. object_u8bit := u8;
  508. object_u16bit := u16;
  509. object_bigstring := bigstring;
  510. object_s32bit := s32;
  511. object_s64bit := s64;
  512. end;
  513. procedure theritedvmtobject.method_normal_call_static_params_mixed(
  514. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  515. begin
  516. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  517. end;
  518. procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
  519. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  520. begin
  521. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  522. end;
  523. procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
  524. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  525. begin
  526. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  527. end;
  528. procedure theritedvmtobject.method_normal_call_normal_params_mixed(
  529. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  530. begin
  531. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  532. end;
  533. procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
  534. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  535. begin
  536. constructor_params_mixed(u8, u16, bigstring, s32, s64);
  537. end;
  538. procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
  539. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  540. begin
  541. Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
  542. s32, s64);
  543. end;
  544. procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
  545. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
  546. begin
  547. Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
  548. s32, s64);
  549. end;
  550. procedure testnovmtobject;
  551. var
  552. novmtobject : tnovmtobject;
  553. failed : boolean;
  554. begin
  555. {******************** STATIC / METHOD SIMPLE CALL **********************}
  556. Write('No parameter / method call testing...');
  557. failed := false;
  558. clear_globals;
  559. clear_values;
  560. tnovmtobject.method_public_static_none;
  561. if global_u8bit <> RESULT_U8BIT then
  562. failed := true;
  563. clear_globals;
  564. clear_values;
  565. novmtobject.method_public_static_none;
  566. if global_u8bit <> RESULT_U8BIT then
  567. failed := true;
  568. clear_globals;
  569. clear_values;
  570. tnovmtobject.method_call_private_static_none;
  571. if global_u16bit <> RESULT_U8BIT then
  572. failed := true;
  573. clear_globals;
  574. clear_values;
  575. novmtobject.method_call_private_static_none;
  576. if global_u16bit <> RESULT_U8BIT then
  577. failed := true;
  578. clear_globals;
  579. clear_values;
  580. novmtobject.method_public_none;
  581. if global_u8bit <> RESULT_U8BIT then
  582. failed := true;
  583. clear_globals;
  584. clear_values;
  585. novmtobject.method_call_private_none;
  586. if global_u16bit <> (RESULT_U16BIT) then
  587. failed := true;
  588. if failed then
  589. fail
  590. else
  591. WriteLn('Passed!');
  592. Write('Simple parameter (LOC_CONSTANT) / method call testing...');
  593. failed := false;
  594. clear_globals;
  595. clear_values;
  596. { parameter is LOC_CONSTANT }
  597. novmtobject.method_public_u8(RESULT_U8BIT);
  598. if global_u8bit <> RESULT_U8BIT then
  599. failed := true;
  600. clear_globals;
  601. clear_values;
  602. tnovmtobject.method_public_static_u8(RESULT_U8BIT);
  603. if global_u8bit <> RESULT_U8BIT then
  604. failed := true;
  605. clear_globals;
  606. clear_values;
  607. novmtobject.method_public_static_u8(RESULT_U8BIT);
  608. if global_u8bit <> RESULT_U8BIT then
  609. failed := true;
  610. clear_globals;
  611. clear_values;
  612. novmtobject.method_call_private_u8(RESULT_U8BIT);
  613. if global_u16bit <> (RESULT_U16BIT) then
  614. failed := true;
  615. clear_globals;
  616. clear_values;
  617. novmtobject.method_call_private_static_u8(RESULT_U8BIT);
  618. if global_u16bit <> (RESULT_U8BIT) then
  619. failed := true;
  620. if failed then
  621. fail
  622. else
  623. WriteLn('Passed!');
  624. Write('Simple parameter (LOC_REFERENCE) / method call testing...');
  625. failed := false;
  626. clear_globals;
  627. clear_values;
  628. value_u8bit := RESULT_U8BIT;
  629. novmtobject.method_public_u8(value_u8bit);
  630. if global_u8bit <> RESULT_U8BIT then
  631. failed := true;
  632. clear_globals;
  633. clear_values;
  634. value_u8bit := RESULT_U8BIT;
  635. tnovmtobject.method_public_static_u8(value_u8bit);
  636. if global_u8bit <> RESULT_U8BIT then
  637. failed := true;
  638. clear_globals;
  639. clear_values;
  640. value_u8bit := RESULT_U8BIT;
  641. novmtobject.method_public_static_u8(value_u8bit);
  642. if global_u8bit <> RESULT_U8BIT then
  643. failed := true;
  644. clear_globals;
  645. clear_values;
  646. value_u8bit := RESULT_U8BIT;
  647. novmtobject.method_call_private_u8(value_u8bit);
  648. if global_u16bit <> (RESULT_U16BIT) then
  649. failed := true;
  650. clear_globals;
  651. clear_values;
  652. value_u8bit := RESULT_U8BIT;
  653. novmtobject.method_call_private_static_u8(value_u8bit);
  654. if global_u16bit <> (RESULT_U8BIT) then
  655. failed := true;
  656. if failed then
  657. fail
  658. else
  659. WriteLn('Passed!');
  660. Write('Simple parameter (LOC_REGISTER) / method call testing...');
  661. failed := false;
  662. clear_globals;
  663. clear_values;
  664. novmtobject.method_public_u8(getu8);
  665. if global_u8bit <> RESULT_U8BIT then
  666. failed := true;
  667. clear_globals;
  668. clear_values;
  669. tnovmtobject.method_public_static_u8(getu8);
  670. if global_u8bit <> RESULT_U8BIT then
  671. failed := true;
  672. clear_globals;
  673. clear_values;
  674. novmtobject.method_public_static_u8(getu8);
  675. if global_u8bit <> RESULT_U8BIT then
  676. failed := true;
  677. clear_globals;
  678. clear_values;
  679. novmtobject.method_call_private_u8(getu8);
  680. if global_u16bit <> (RESULT_U16BIT) then
  681. failed := true;
  682. clear_globals;
  683. clear_values;
  684. novmtobject.method_call_private_static_u8(getu8);
  685. if global_u16bit <> (RESULT_U8BIT) then
  686. failed := true;
  687. if failed then
  688. fail
  689. else
  690. WriteLn('Passed!');
  691. Write('Simple parameter / complex return / nested method access testing...');
  692. clear_globals;
  693. clear_values;
  694. failed := false;
  695. novmtobject.object_bigstring := RESULT_BIGSTRING;
  696. novmtobject.object_u16bit := RESULT_U16BIT;
  697. value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
  698. if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
  699. failed := true;
  700. if global_u8bit <> RESULT_U8BIT then
  701. failed := true;
  702. if global_bigstring <> RESULT_BIGSTRING then
  703. failed := true;
  704. if global_u16bit <> RESULT_U16BIT then
  705. failed := true;
  706. if global_s32bit <> RESULT_S32BIT then
  707. failed := true;
  708. if global_s64bit <> RESULT_U8BIT then
  709. failed := true;
  710. if failed then
  711. fail
  712. else
  713. WriteLn('Passed!');
  714. end;
  715. procedure testfailedobject;
  716. var
  717. failedobject : tfailvmtobject;
  718. begin
  719. Write('Testing constructor return value...');
  720. if failedobject.constructor_public_none then
  721. fail
  722. else
  723. Writeln('Passed!');
  724. end;
  725. procedure testvmtobject;
  726. var
  727. vmtobject : tvmtobject;
  728. failed : boolean;
  729. begin
  730. clear_globals;
  731. clear_values;
  732. failed := false;
  733. Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
  734. vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  735. if vmtobject.object_u8bit <> RESULT_U8BIT then
  736. failed := true;
  737. if vmtobject.object_u16bit <> RESULT_U16BIT then
  738. failed := true;
  739. if vmtobject.object_s32bit <> RESULT_S32BIT then
  740. failed := true;
  741. if vmtobject.object_s64bit <> RESULT_S64BIT then
  742. failed := true;
  743. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  744. failed := true;
  745. vmtobject.destructor_params_done;
  746. if failed then
  747. fail
  748. else
  749. Writeln('Passed!');
  750. clear_globals;
  751. clear_values;
  752. failed := false;
  753. Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
  754. value_u8bit := RESULT_U8BIT;
  755. value_u16bit := RESULT_U16BIT;
  756. value_bigstring := RESULT_BIGSTRING;
  757. value_s32bit := RESULT_S32BIT;
  758. value_s64bit := RESULT_S64BIT;
  759. vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring,
  760. value_s32bit, value_s64bit);
  761. if vmtobject.object_u8bit <> RESULT_U8BIT then
  762. failed := true;
  763. if vmtobject.object_u16bit <> RESULT_U16BIT then
  764. failed := true;
  765. if vmtobject.object_s32bit <> RESULT_S32BIT then
  766. failed := true;
  767. if vmtobject.object_s64bit <> RESULT_S64BIT then
  768. failed := true;
  769. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  770. failed := true;
  771. vmtobject.destructor_params_done;
  772. if failed then
  773. fail
  774. else
  775. Writeln('Passed!');
  776. end;
  777. procedure testheritedvmtobject;
  778. var
  779. vmtobject : theritedvmtobject;
  780. failed : boolean;
  781. begin
  782. {********************** CONSTRUCTOR TESTING ************************}
  783. {********************** DESTRUCTOR TESTING ************************}
  784. clear_globals;
  785. clear_values;
  786. failed := false;
  787. Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
  788. vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING,
  789. RESULT_S32BIT, RESULT_S64BIT);
  790. if vmtobject.object_u8bit <> RESULT_U8BIT then
  791. failed := true;
  792. if vmtobject.object_u16bit <> RESULT_U16BIT then
  793. failed := true;
  794. if vmtobject.object_s32bit <> RESULT_S32BIT then
  795. failed := true;
  796. if vmtobject.object_s64bit <> RESULT_S64BIT then
  797. failed := true;
  798. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  799. failed := true;
  800. vmtobject.destructor_params_done;
  801. if failed then
  802. fail
  803. else
  804. Writeln('Passed!');
  805. clear_globals;
  806. clear_values;
  807. failed := false;
  808. Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
  809. value_u8bit := RESULT_U8BIT;
  810. value_u16bit := RESULT_U16BIT;
  811. value_bigstring := RESULT_BIGSTRING;
  812. value_s32bit := RESULT_S32BIT;
  813. value_s64bit := RESULT_S64BIT;
  814. vmtobject.constructor_params_mixed_call_inherited(value_u8bit,
  815. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  816. if vmtobject.object_u8bit <> RESULT_U8BIT then
  817. failed := true;
  818. if vmtobject.object_u16bit <> RESULT_U16BIT then
  819. failed := true;
  820. if vmtobject.object_s32bit <> RESULT_S32BIT then
  821. failed := true;
  822. if vmtobject.object_s64bit <> RESULT_S64BIT then
  823. failed := true;
  824. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  825. failed := true;
  826. vmtobject.destructor_params_done;
  827. if failed then
  828. fail
  829. else
  830. Writeln('Passed!');
  831. clear_globals;
  832. clear_values;
  833. failed := false;
  834. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  835. vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT,
  836. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  837. if vmtobject.object_u8bit <> RESULT_U8BIT then
  838. failed := true;
  839. if vmtobject.object_u16bit <> RESULT_U16BIT then
  840. failed := true;
  841. if vmtobject.object_s32bit <> RESULT_S32BIT then
  842. failed := true;
  843. if vmtobject.object_s64bit <> RESULT_S64BIT then
  844. failed := true;
  845. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  846. failed := true;
  847. vmtobject.destructor_params_done;
  848. if failed then
  849. fail
  850. else
  851. Writeln('Passed!');
  852. clear_globals;
  853. clear_values;
  854. failed := false;
  855. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  856. value_u8bit := RESULT_U8BIT;
  857. value_u16bit := RESULT_U16BIT;
  858. value_bigstring := RESULT_BIGSTRING;
  859. value_s32bit := RESULT_S32BIT;
  860. value_s64bit := RESULT_S64BIT;
  861. vmtobject.constructor_params_mixed_call_virtual(value_u8bit,
  862. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  863. if vmtobject.object_u8bit <> RESULT_U8BIT then
  864. failed := true;
  865. if vmtobject.object_u16bit <> RESULT_U16BIT then
  866. failed := true;
  867. if vmtobject.object_s32bit <> RESULT_S32BIT then
  868. failed := true;
  869. if vmtobject.object_s64bit <> RESULT_S64BIT then
  870. failed := true;
  871. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  872. failed := true;
  873. vmtobject.destructor_params_done;
  874. if failed then
  875. fail
  876. else
  877. Writeln('Passed!');
  878. clear_globals;
  879. clear_values;
  880. failed := false;
  881. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  882. vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT,
  883. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  884. if vmtobject.object_u8bit <> RESULT_U8BIT then
  885. failed := true;
  886. if vmtobject.object_u16bit <> RESULT_U16BIT then
  887. failed := true;
  888. if vmtobject.object_s32bit <> RESULT_S32BIT then
  889. failed := true;
  890. if vmtobject.object_s64bit <> RESULT_S64BIT then
  891. failed := true;
  892. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  893. failed := true;
  894. vmtobject.destructor_params_done;
  895. if failed then
  896. fail
  897. else
  898. Writeln('Passed!');
  899. clear_globals;
  900. clear_values;
  901. failed := false;
  902. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  903. value_u8bit := RESULT_U8BIT;
  904. value_u16bit := RESULT_U16BIT;
  905. value_bigstring := RESULT_BIGSTRING;
  906. value_s32bit := RESULT_S32BIT;
  907. value_s64bit := RESULT_S64BIT;
  908. vmtobject.constructor_params_mixed_call_overriden(value_u8bit,
  909. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  910. if vmtobject.object_u8bit <> RESULT_U8BIT then
  911. failed := true;
  912. if vmtobject.object_u16bit <> RESULT_U16BIT then
  913. failed := true;
  914. if vmtobject.object_s32bit <> RESULT_S32BIT then
  915. failed := true;
  916. if vmtobject.object_s64bit <> RESULT_S64BIT then
  917. failed := true;
  918. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  919. failed := true;
  920. vmtobject.destructor_params_done;
  921. if failed then
  922. fail
  923. else
  924. Writeln('Passed!');
  925. clear_globals;
  926. clear_values;
  927. failed := false;
  928. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
  929. vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT,
  930. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  931. if vmtobject.object_u8bit <> RESULT_U8BIT then
  932. failed := true;
  933. if vmtobject.object_u16bit <> RESULT_U16BIT then
  934. failed := true;
  935. if vmtobject.object_s32bit <> RESULT_S32BIT then
  936. failed := true;
  937. if vmtobject.object_s64bit <> RESULT_S64BIT then
  938. failed := true;
  939. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  940. failed := true;
  941. vmtobject.destructor_params_done;
  942. if failed then
  943. fail
  944. else
  945. Writeln('Passed!');
  946. clear_globals;
  947. clear_values;
  948. failed := false;
  949. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
  950. value_u8bit := RESULT_U8BIT;
  951. value_u16bit := RESULT_U16BIT;
  952. value_bigstring := RESULT_BIGSTRING;
  953. value_s32bit := RESULT_S32BIT;
  954. value_s64bit := RESULT_S64BIT;
  955. vmtobject.constructor_params_mixed_call_normal(value_u8bit,
  956. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  957. if vmtobject.object_u8bit <> RESULT_U8BIT then
  958. failed := true;
  959. if vmtobject.object_u16bit <> RESULT_U16BIT then
  960. failed := true;
  961. if vmtobject.object_s32bit <> RESULT_S32BIT then
  962. failed := true;
  963. if vmtobject.object_s64bit <> RESULT_S64BIT then
  964. failed := true;
  965. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  966. failed := true;
  967. vmtobject.destructor_params_done;
  968. if failed then
  969. fail
  970. else
  971. Writeln('Passed!');
  972. clear_globals;
  973. clear_values;
  974. failed := false;
  975. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
  976. vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT,
  977. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  978. if global_u8bit <> RESULT_U8BIT then
  979. failed := true;
  980. if global_u16bit <> RESULT_U16BIT then
  981. failed := true;
  982. if global_s32bit <> RESULT_S32BIT then
  983. failed := true;
  984. if global_s64bit <> RESULT_S64BIT then
  985. failed := true;
  986. if global_bigstring <> RESULT_BIGSTRING then
  987. failed := true;
  988. vmtobject.destructor_params_done;
  989. if failed then
  990. fail
  991. else
  992. Writeln('Passed!');
  993. clear_globals;
  994. clear_values;
  995. failed := false;
  996. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
  997. value_u8bit := RESULT_U8BIT;
  998. value_u16bit := RESULT_U16BIT;
  999. value_bigstring := RESULT_BIGSTRING;
  1000. value_s32bit := RESULT_S32BIT;
  1001. value_s64bit := RESULT_S64BIT;
  1002. vmtobject.constructor_params_mixed_call_static(value_u8bit,
  1003. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1004. if global_u8bit <> RESULT_U8BIT then
  1005. failed := true;
  1006. if global_u16bit <> RESULT_U16BIT then
  1007. failed := true;
  1008. if global_s32bit <> RESULT_S32BIT then
  1009. failed := true;
  1010. if global_s64bit <> RESULT_S64BIT then
  1011. failed := true;
  1012. if global_bigstring <> RESULT_BIGSTRING then
  1013. failed := true;
  1014. vmtobject.destructor_params_done;
  1015. if failed then
  1016. fail
  1017. else
  1018. Writeln('Passed!');
  1019. {************************* METHOD TESTING **************************}
  1020. clear_globals;
  1021. clear_values;
  1022. failed := false;
  1023. vmtobject.constructor_init;
  1024. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  1025. vmtobject.method_virtual_params_mixed(RESULT_U8BIT,
  1026. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1027. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1028. failed := true;
  1029. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1030. failed := true;
  1031. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1032. failed := true;
  1033. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1034. failed := true;
  1035. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1036. failed := true;
  1037. vmtobject.destructor_params_done;
  1038. if failed then
  1039. fail
  1040. else
  1041. Writeln('Passed!');
  1042. clear_globals;
  1043. clear_values;
  1044. failed := false;
  1045. vmtobject.constructor_init;
  1046. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  1047. value_u8bit := RESULT_U8BIT;
  1048. value_u16bit := RESULT_U16BIT;
  1049. value_bigstring := RESULT_BIGSTRING;
  1050. value_s32bit := RESULT_S32BIT;
  1051. value_s64bit := RESULT_S64BIT;
  1052. vmtobject.method_virtual_params_mixed(value_u8bit,
  1053. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1054. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1055. failed := true;
  1056. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1057. failed := true;
  1058. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1059. failed := true;
  1060. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1061. failed := true;
  1062. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1063. failed := true;
  1064. vmtobject.destructor_params_done;
  1065. if failed then
  1066. fail
  1067. else
  1068. Writeln('Passed!');
  1069. clear_globals;
  1070. clear_values;
  1071. failed := false;
  1072. vmtobject.constructor_init;
  1073. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  1074. vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT,
  1075. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1076. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1077. failed := true;
  1078. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1079. failed := true;
  1080. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1081. failed := true;
  1082. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1083. failed := true;
  1084. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1085. failed := true;
  1086. vmtobject.destructor_params_done;
  1087. if failed then
  1088. fail
  1089. else
  1090. Writeln('Passed!');
  1091. clear_globals;
  1092. clear_values;
  1093. failed := false;
  1094. vmtobject.constructor_init;
  1095. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  1096. value_u8bit := RESULT_U8BIT;
  1097. value_u16bit := RESULT_U16BIT;
  1098. value_bigstring := RESULT_BIGSTRING;
  1099. value_s32bit := RESULT_S32BIT;
  1100. value_s64bit := RESULT_S64BIT;
  1101. vmtobject.method_virtual_overriden_params_mixed(value_u8bit,
  1102. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1103. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1104. failed := true;
  1105. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1106. failed := true;
  1107. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1108. failed := true;
  1109. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1110. failed := true;
  1111. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1112. failed := true;
  1113. vmtobject.destructor_params_done;
  1114. if failed then
  1115. fail
  1116. else
  1117. Writeln('Passed!');
  1118. clear_globals;
  1119. clear_values;
  1120. failed := false;
  1121. vmtobject.constructor_init;
  1122. Write('Testing mixed parameter (LOC_CONSTANT) method call...');
  1123. vmtobject.method_normal_params_mixed(RESULT_U8BIT,
  1124. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1125. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1126. failed := true;
  1127. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1128. failed := true;
  1129. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1130. failed := true;
  1131. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1132. failed := true;
  1133. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1134. failed := true;
  1135. vmtobject.destructor_params_done;
  1136. if failed then
  1137. fail
  1138. else
  1139. Writeln('Passed!');
  1140. clear_globals;
  1141. clear_values;
  1142. failed := false;
  1143. vmtobject.constructor_init;
  1144. Write('Testing mixed parameter (LOC_REFERENCE) method call...');
  1145. value_u8bit := RESULT_U8BIT;
  1146. value_u16bit := RESULT_U16BIT;
  1147. value_bigstring := RESULT_BIGSTRING;
  1148. value_s32bit := RESULT_S32BIT;
  1149. value_s64bit := RESULT_S64BIT;
  1150. vmtobject.method_normal_params_mixed(value_u8bit,
  1151. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1152. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1153. failed := true;
  1154. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1155. failed := true;
  1156. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1157. failed := true;
  1158. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1159. failed := true;
  1160. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1161. failed := true;
  1162. vmtobject.destructor_params_done;
  1163. if failed then
  1164. fail
  1165. else
  1166. Writeln('Passed!');
  1167. clear_globals;
  1168. clear_values;
  1169. failed := false;
  1170. vmtobject.constructor_init;
  1171. Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
  1172. vmtobject.method_static_params_mixed(RESULT_U8BIT,
  1173. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1174. if global_u8bit <> RESULT_U8BIT then
  1175. failed := true;
  1176. if global_u16bit <> RESULT_U16BIT then
  1177. failed := true;
  1178. if global_s32bit <> RESULT_S32BIT then
  1179. failed := true;
  1180. if global_s64bit <> RESULT_S64BIT then
  1181. failed := true;
  1182. if global_bigstring <> RESULT_BIGSTRING then
  1183. failed := true;
  1184. vmtobject.destructor_params_done;
  1185. if failed then
  1186. fail
  1187. else
  1188. Writeln('Passed!');
  1189. clear_globals;
  1190. clear_values;
  1191. failed := false;
  1192. vmtobject.constructor_init;
  1193. Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
  1194. value_u8bit := RESULT_U8BIT;
  1195. value_u16bit := RESULT_U16BIT;
  1196. value_bigstring := RESULT_BIGSTRING;
  1197. value_s32bit := RESULT_S32BIT;
  1198. value_s64bit := RESULT_S64BIT;
  1199. vmtobject.method_static_params_mixed(value_u8bit,
  1200. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1201. if global_u8bit <> RESULT_U8BIT then
  1202. failed := true;
  1203. if global_u16bit <> RESULT_U16BIT then
  1204. failed := true;
  1205. if global_s32bit <> RESULT_S32BIT then
  1206. failed := true;
  1207. if global_s64bit <> RESULT_S64BIT then
  1208. failed := true;
  1209. if global_bigstring <> RESULT_BIGSTRING then
  1210. failed := true;
  1211. vmtobject.destructor_params_done;
  1212. if failed then
  1213. fail
  1214. else
  1215. Writeln('Passed!');
  1216. { ********************************************************************
  1217. This calls methods which in turn call other methods, or a constructor
  1218. or a destructor.
  1219. *********************************************************************
  1220. }
  1221. clear_globals;
  1222. clear_values;
  1223. failed := false;
  1224. { Calls the ancestor virtual method }
  1225. vmtobject.constructor_init;
  1226. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  1227. vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT,
  1228. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1229. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1230. failed := true;
  1231. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1232. failed := true;
  1233. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1234. failed := true;
  1235. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1236. failed := true;
  1237. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1238. failed := true;
  1239. vmtobject.destructor_params_done;
  1240. if failed then
  1241. fail
  1242. else
  1243. Writeln('Passed!');
  1244. clear_globals;
  1245. clear_values;
  1246. failed := false;
  1247. vmtobject.constructor_init;
  1248. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  1249. value_u8bit := RESULT_U8BIT;
  1250. value_u16bit := RESULT_U16BIT;
  1251. value_bigstring := RESULT_BIGSTRING;
  1252. value_s32bit := RESULT_S32BIT;
  1253. value_s64bit := RESULT_S64BIT;
  1254. vmtobject.method_normal_call_virtual_params_mixed(value_u8bit,
  1255. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1256. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1257. failed := true;
  1258. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1259. failed := true;
  1260. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1261. failed := true;
  1262. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1263. failed := true;
  1264. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1265. failed := true;
  1266. vmtobject.destructor_params_done;
  1267. if failed then
  1268. fail
  1269. else
  1270. Writeln('Passed!');
  1271. { The virtual method has been overriden by the object in this case }
  1272. vmtobject.constructor_init;
  1273. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  1274. vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT,
  1275. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1276. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1277. failed := true;
  1278. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1279. failed := true;
  1280. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1281. failed := true;
  1282. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1283. failed := true;
  1284. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1285. failed := true;
  1286. vmtobject.destructor_params_done;
  1287. if failed then
  1288. fail
  1289. else
  1290. Writeln('Passed!');
  1291. clear_globals;
  1292. clear_values;
  1293. failed := false;
  1294. vmtobject.constructor_init;
  1295. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  1296. value_u8bit := RESULT_U8BIT;
  1297. value_u16bit := RESULT_U16BIT;
  1298. value_bigstring := RESULT_BIGSTRING;
  1299. value_s32bit := RESULT_S32BIT;
  1300. value_s64bit := RESULT_S64BIT;
  1301. vmtobject.method_normal_call_overriden_params_mixed(value_u8bit,
  1302. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1303. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1304. failed := true;
  1305. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1306. failed := true;
  1307. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1308. failed := true;
  1309. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1310. failed := true;
  1311. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1312. failed := true;
  1313. vmtobject.destructor_params_done;
  1314. if failed then
  1315. fail
  1316. else
  1317. Writeln('Passed!');
  1318. clear_globals;
  1319. clear_values;
  1320. failed := false;
  1321. vmtobject.constructor_init;
  1322. Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
  1323. vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT,
  1324. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1325. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1326. failed := true;
  1327. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1328. failed := true;
  1329. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1330. failed := true;
  1331. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1332. failed := true;
  1333. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1334. failed := true;
  1335. vmtobject.destructor_params_done;
  1336. if failed then
  1337. fail
  1338. else
  1339. Writeln('Passed!');
  1340. clear_globals;
  1341. clear_values;
  1342. failed := false;
  1343. vmtobject.constructor_init;
  1344. Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
  1345. value_u8bit := RESULT_U8BIT;
  1346. value_u16bit := RESULT_U16BIT;
  1347. value_bigstring := RESULT_BIGSTRING;
  1348. value_s32bit := RESULT_S32BIT;
  1349. value_s64bit := RESULT_S64BIT;
  1350. vmtobject.method_normal_call_normal_params_mixed(value_u8bit,
  1351. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1352. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1353. failed := true;
  1354. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1355. failed := true;
  1356. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1357. failed := true;
  1358. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1359. failed := true;
  1360. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1361. failed := true;
  1362. vmtobject.destructor_params_done;
  1363. if failed then
  1364. fail
  1365. else
  1366. Writeln('Passed!');
  1367. (* constructor call inside a normal method *)
  1368. clear_globals;
  1369. clear_values;
  1370. failed := false;
  1371. vmtobject.constructor_init;
  1372. Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
  1373. vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT,
  1374. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1375. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1376. failed := true;
  1377. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1378. failed := true;
  1379. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1380. failed := true;
  1381. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1382. failed := true;
  1383. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1384. failed := true;
  1385. vmtobject.destructor_params_done;
  1386. if failed then
  1387. fail
  1388. else
  1389. Writeln('Passed!');
  1390. clear_globals;
  1391. clear_values;
  1392. failed := false;
  1393. vmtobject.constructor_init;
  1394. Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
  1395. value_u8bit := RESULT_U8BIT;
  1396. value_u16bit := RESULT_U16BIT;
  1397. value_bigstring := RESULT_BIGSTRING;
  1398. value_s32bit := RESULT_S32BIT;
  1399. value_s64bit := RESULT_S64BIT;
  1400. vmtobject.method_normal_call_constructor_params_mixed(value_u8bit,
  1401. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1402. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1403. failed := true;
  1404. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1405. failed := true;
  1406. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1407. failed := true;
  1408. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1409. failed := true;
  1410. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1411. failed := true;
  1412. vmtobject.destructor_params_done;
  1413. if failed then
  1414. fail
  1415. else
  1416. Writeln('Passed!');
  1417. { static method call }
  1418. clear_globals;
  1419. clear_values;
  1420. failed := false;
  1421. vmtobject.constructor_init;
  1422. Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
  1423. vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT,
  1424. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1425. if global_u8bit <> RESULT_U8BIT then
  1426. failed := true;
  1427. if global_u16bit <> RESULT_U16BIT then
  1428. failed := true;
  1429. if global_s32bit <> RESULT_S32BIT then
  1430. failed := true;
  1431. if global_s64bit <> RESULT_S64BIT then
  1432. failed := true;
  1433. if global_bigstring <> RESULT_BIGSTRING then
  1434. failed := true;
  1435. vmtobject.destructor_params_done;
  1436. if failed then
  1437. fail
  1438. else
  1439. Writeln('Passed!');
  1440. clear_globals;
  1441. clear_values;
  1442. failed := false;
  1443. vmtobject.constructor_init;
  1444. Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
  1445. value_u8bit := RESULT_U8BIT;
  1446. value_u16bit := RESULT_U16BIT;
  1447. value_bigstring := RESULT_BIGSTRING;
  1448. value_s32bit := RESULT_S32BIT;
  1449. value_s64bit := RESULT_S64BIT;
  1450. vmtobject.method_normal_call_static_params_mixed(value_u8bit,
  1451. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1452. if global_u8bit <> RESULT_U8BIT then
  1453. failed := true;
  1454. if global_u16bit <> RESULT_U16BIT then
  1455. failed := true;
  1456. if global_s32bit <> RESULT_S32BIT then
  1457. failed := true;
  1458. if global_s64bit <> RESULT_S64BIT then
  1459. failed := true;
  1460. if global_bigstring <> RESULT_BIGSTRING then
  1461. failed := true;
  1462. vmtobject.destructor_params_done;
  1463. if failed then
  1464. fail
  1465. else
  1466. Writeln('Passed!');
  1467. (* calls the inherited method *)
  1468. clear_globals;
  1469. clear_values;
  1470. failed := false;
  1471. { Calls the ancestor virtual method }
  1472. vmtobject.constructor_init;
  1473. Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
  1474. vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT,
  1475. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1476. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1477. failed := true;
  1478. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1479. failed := true;
  1480. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1481. failed := true;
  1482. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1483. failed := true;
  1484. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1485. failed := true;
  1486. vmtobject.destructor_params_done;
  1487. if failed then
  1488. fail
  1489. else
  1490. Writeln('Passed!');
  1491. clear_globals;
  1492. clear_values;
  1493. failed := false;
  1494. vmtobject.constructor_init;
  1495. Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
  1496. value_u8bit := RESULT_U8BIT;
  1497. value_u16bit := RESULT_U16BIT;
  1498. value_bigstring := RESULT_BIGSTRING;
  1499. value_s32bit := RESULT_S32BIT;
  1500. value_s64bit := RESULT_S64BIT;
  1501. vmtobject.method_normal_call_inherited_params_mixed(value_u8bit,
  1502. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1503. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1504. failed := true;
  1505. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1506. failed := true;
  1507. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1508. failed := true;
  1509. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1510. failed := true;
  1511. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1512. failed := true;
  1513. vmtobject.destructor_params_done;
  1514. if failed then
  1515. fail
  1516. else
  1517. Writeln('Passed!');
  1518. { ********************************************************************
  1519. This calls virtual methods which in turn call other methods,
  1520. or a constructor or a destructor.
  1521. *********************************************************************
  1522. }
  1523. clear_globals;
  1524. clear_values;
  1525. failed := false;
  1526. { Calls the ancestor virtual method }
  1527. vmtobject.constructor_init;
  1528. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  1529. vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT,
  1530. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1531. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1532. failed := true;
  1533. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1534. failed := true;
  1535. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1536. failed := true;
  1537. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1538. failed := true;
  1539. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1540. failed := true;
  1541. vmtobject.destructor_params_done;
  1542. if failed then
  1543. fail
  1544. else
  1545. Writeln('Passed!');
  1546. clear_globals;
  1547. clear_values;
  1548. failed := false;
  1549. vmtobject.constructor_init;
  1550. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  1551. value_u8bit := RESULT_U8BIT;
  1552. value_u16bit := RESULT_U16BIT;
  1553. value_bigstring := RESULT_BIGSTRING;
  1554. value_s32bit := RESULT_S32BIT;
  1555. value_s64bit := RESULT_S64BIT;
  1556. vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit,
  1557. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1558. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1559. failed := true;
  1560. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1561. failed := true;
  1562. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1563. failed := true;
  1564. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1565. failed := true;
  1566. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1567. failed := true;
  1568. vmtobject.destructor_params_done;
  1569. if failed then
  1570. fail
  1571. else
  1572. Writeln('Passed!');
  1573. { The virtual method has been overriden by the object in this case }
  1574. vmtobject.constructor_init;
  1575. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  1576. vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT,
  1577. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1578. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1579. failed := true;
  1580. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1581. failed := true;
  1582. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1583. failed := true;
  1584. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1585. failed := true;
  1586. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1587. failed := true;
  1588. vmtobject.destructor_params_done;
  1589. if failed then
  1590. fail
  1591. else
  1592. Writeln('Passed!');
  1593. clear_globals;
  1594. clear_values;
  1595. failed := false;
  1596. vmtobject.constructor_init;
  1597. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  1598. value_u8bit := RESULT_U8BIT;
  1599. value_u16bit := RESULT_U16BIT;
  1600. value_bigstring := RESULT_BIGSTRING;
  1601. value_s32bit := RESULT_S32BIT;
  1602. value_s64bit := RESULT_S64BIT;
  1603. vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit,
  1604. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1605. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1606. failed := true;
  1607. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1608. failed := true;
  1609. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1610. failed := true;
  1611. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1612. failed := true;
  1613. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1614. failed := true;
  1615. vmtobject.destructor_params_done;
  1616. if failed then
  1617. fail
  1618. else
  1619. Writeln('Passed!');
  1620. clear_globals;
  1621. clear_values;
  1622. failed := false;
  1623. vmtobject.constructor_init;
  1624. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
  1625. vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT,
  1626. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1627. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1628. failed := true;
  1629. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1630. failed := true;
  1631. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1632. failed := true;
  1633. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1634. failed := true;
  1635. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1636. failed := true;
  1637. vmtobject.destructor_params_done;
  1638. if failed then
  1639. fail
  1640. else
  1641. Writeln('Passed!');
  1642. clear_globals;
  1643. clear_values;
  1644. failed := false;
  1645. vmtobject.constructor_init;
  1646. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
  1647. value_u8bit := RESULT_U8BIT;
  1648. value_u16bit := RESULT_U16BIT;
  1649. value_bigstring := RESULT_BIGSTRING;
  1650. value_s32bit := RESULT_S32BIT;
  1651. value_s64bit := RESULT_S64BIT;
  1652. vmtobject.method_virtual_call_normal_params_mixed(value_u8bit,
  1653. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1654. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1655. failed := true;
  1656. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1657. failed := true;
  1658. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1659. failed := true;
  1660. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1661. failed := true;
  1662. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1663. failed := true;
  1664. vmtobject.destructor_params_done;
  1665. if failed then
  1666. fail
  1667. else
  1668. Writeln('Passed!');
  1669. (* constructor call inside a normal method *)
  1670. clear_globals;
  1671. clear_values;
  1672. failed := false;
  1673. vmtobject.constructor_init;
  1674. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
  1675. vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT,
  1676. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1677. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1678. failed := true;
  1679. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1680. failed := true;
  1681. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1682. failed := true;
  1683. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1684. failed := true;
  1685. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1686. failed := true;
  1687. vmtobject.destructor_params_done;
  1688. if failed then
  1689. fail
  1690. else
  1691. Writeln('Passed!');
  1692. clear_globals;
  1693. clear_values;
  1694. failed := false;
  1695. vmtobject.constructor_init;
  1696. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
  1697. value_u8bit := RESULT_U8BIT;
  1698. value_u16bit := RESULT_U16BIT;
  1699. value_bigstring := RESULT_BIGSTRING;
  1700. value_s32bit := RESULT_S32BIT;
  1701. value_s64bit := RESULT_S64BIT;
  1702. vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit,
  1703. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1704. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1705. failed := true;
  1706. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1707. failed := true;
  1708. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1709. failed := true;
  1710. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1711. failed := true;
  1712. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1713. failed := true;
  1714. vmtobject.destructor_params_done;
  1715. if failed then
  1716. fail
  1717. else
  1718. Writeln('Passed!');
  1719. { static virtual call }
  1720. clear_globals;
  1721. clear_values;
  1722. failed := false;
  1723. vmtobject.constructor_init;
  1724. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
  1725. vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT,
  1726. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1727. if global_u8bit <> RESULT_U8BIT then
  1728. failed := true;
  1729. if global_u16bit <> RESULT_U16BIT then
  1730. failed := true;
  1731. if global_s32bit <> RESULT_S32BIT then
  1732. failed := true;
  1733. if global_s64bit <> RESULT_S64BIT then
  1734. failed := true;
  1735. if global_bigstring <> RESULT_BIGSTRING then
  1736. failed := true;
  1737. vmtobject.destructor_params_done;
  1738. if failed then
  1739. fail
  1740. else
  1741. Writeln('Passed!');
  1742. clear_globals;
  1743. clear_values;
  1744. failed := false;
  1745. vmtobject.constructor_init;
  1746. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
  1747. value_u8bit := RESULT_U8BIT;
  1748. value_u16bit := RESULT_U16BIT;
  1749. value_bigstring := RESULT_BIGSTRING;
  1750. value_s32bit := RESULT_S32BIT;
  1751. value_s64bit := RESULT_S64BIT;
  1752. vmtobject.method_virtual_call_static_params_mixed(value_u8bit,
  1753. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1754. if global_u8bit <> RESULT_U8BIT then
  1755. failed := true;
  1756. if global_u16bit <> RESULT_U16BIT then
  1757. failed := true;
  1758. if global_s32bit <> RESULT_S32BIT then
  1759. failed := true;
  1760. if global_s64bit <> RESULT_S64BIT then
  1761. failed := true;
  1762. if global_bigstring <> RESULT_BIGSTRING then
  1763. failed := true;
  1764. vmtobject.destructor_params_done;
  1765. if failed then
  1766. fail
  1767. else
  1768. Writeln('Passed!');
  1769. (* calls the inherited method *)
  1770. clear_globals;
  1771. clear_values;
  1772. failed := false;
  1773. { Calls the ancestor virtual method }
  1774. vmtobject.constructor_init;
  1775. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
  1776. vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT,
  1777. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1778. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1779. failed := true;
  1780. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1781. failed := true;
  1782. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1783. failed := true;
  1784. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1785. failed := true;
  1786. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1787. failed := true;
  1788. vmtobject.destructor_params_done;
  1789. if failed then
  1790. fail
  1791. else
  1792. Writeln('Passed!');
  1793. clear_globals;
  1794. clear_values;
  1795. failed := false;
  1796. vmtobject.constructor_init;
  1797. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
  1798. value_u8bit := RESULT_U8BIT;
  1799. value_u16bit := RESULT_U16BIT;
  1800. value_bigstring := RESULT_BIGSTRING;
  1801. value_s32bit := RESULT_S32BIT;
  1802. value_s64bit := RESULT_S64BIT;
  1803. vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit,
  1804. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1805. if vmtobject.object_u8bit <> RESULT_U8BIT then
  1806. failed := true;
  1807. if vmtobject.object_u16bit <> RESULT_U16BIT then
  1808. failed := true;
  1809. if vmtobject.object_s32bit <> RESULT_S32BIT then
  1810. failed := true;
  1811. if vmtobject.object_s64bit <> RESULT_S64BIT then
  1812. failed := true;
  1813. if vmtobject.object_bigstring <> RESULT_BIGSTRING then
  1814. failed := true;
  1815. vmtobject.destructor_params_done;
  1816. if failed then
  1817. fail
  1818. else
  1819. Writeln('Passed!');
  1820. end;
  1821. { same as testvmtherited, except uses with statement }
  1822. procedure testwith;
  1823. var
  1824. vmtobject : theritedvmtobject;
  1825. failed : boolean;
  1826. begin
  1827. with vmtobject do
  1828. begin
  1829. {********************** CONSTRUCTOR TESTING ************************}
  1830. {********************** DESTRUCTOR TESTING ************************}
  1831. clear_globals;
  1832. clear_values;
  1833. failed := false;
  1834. Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
  1835. constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING,
  1836. RESULT_S32BIT, RESULT_S64BIT);
  1837. if object_u8bit <> RESULT_U8BIT then
  1838. failed := true;
  1839. if object_u16bit <> RESULT_U16BIT then
  1840. failed := true;
  1841. if object_s32bit <> RESULT_S32BIT then
  1842. failed := true;
  1843. if object_s64bit <> RESULT_S64BIT then
  1844. failed := true;
  1845. if object_bigstring <> RESULT_BIGSTRING then
  1846. failed := true;
  1847. destructor_params_done;
  1848. if failed then
  1849. fail
  1850. else
  1851. Writeln('Passed!');
  1852. clear_globals;
  1853. clear_values;
  1854. failed := false;
  1855. Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
  1856. value_u8bit := RESULT_U8BIT;
  1857. value_u16bit := RESULT_U16BIT;
  1858. value_bigstring := RESULT_BIGSTRING;
  1859. value_s32bit := RESULT_S32BIT;
  1860. value_s64bit := RESULT_S64BIT;
  1861. constructor_params_mixed_call_inherited(value_u8bit,
  1862. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1863. if object_u8bit <> RESULT_U8BIT then
  1864. failed := true;
  1865. if object_u16bit <> RESULT_U16BIT then
  1866. failed := true;
  1867. if object_s32bit <> RESULT_S32BIT then
  1868. failed := true;
  1869. if object_s64bit <> RESULT_S64BIT then
  1870. failed := true;
  1871. if object_bigstring <> RESULT_BIGSTRING then
  1872. failed := true;
  1873. destructor_params_done;
  1874. if failed then
  1875. fail
  1876. else
  1877. Writeln('Passed!');
  1878. clear_globals;
  1879. clear_values;
  1880. failed := false;
  1881. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  1882. constructor_params_mixed_call_virtual(RESULT_U8BIT,
  1883. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1884. if object_u8bit <> RESULT_U8BIT then
  1885. failed := true;
  1886. if object_u16bit <> RESULT_U16BIT then
  1887. failed := true;
  1888. if object_s32bit <> RESULT_S32BIT then
  1889. failed := true;
  1890. if object_s64bit <> RESULT_S64BIT then
  1891. failed := true;
  1892. if object_bigstring <> RESULT_BIGSTRING then
  1893. failed := true;
  1894. destructor_params_done;
  1895. if failed then
  1896. fail
  1897. else
  1898. Writeln('Passed!');
  1899. clear_globals;
  1900. clear_values;
  1901. failed := false;
  1902. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  1903. value_u8bit := RESULT_U8BIT;
  1904. value_u16bit := RESULT_U16BIT;
  1905. value_bigstring := RESULT_BIGSTRING;
  1906. value_s32bit := RESULT_S32BIT;
  1907. value_s64bit := RESULT_S64BIT;
  1908. constructor_params_mixed_call_virtual(value_u8bit,
  1909. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1910. if object_u8bit <> RESULT_U8BIT then
  1911. failed := true;
  1912. if object_u16bit <> RESULT_U16BIT then
  1913. failed := true;
  1914. if object_s32bit <> RESULT_S32BIT then
  1915. failed := true;
  1916. if object_s64bit <> RESULT_S64BIT then
  1917. failed := true;
  1918. if object_bigstring <> RESULT_BIGSTRING then
  1919. failed := true;
  1920. destructor_params_done;
  1921. if failed then
  1922. fail
  1923. else
  1924. Writeln('Passed!');
  1925. clear_globals;
  1926. clear_values;
  1927. failed := false;
  1928. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  1929. constructor_params_mixed_call_overriden(RESULT_U8BIT,
  1930. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1931. if object_u8bit <> RESULT_U8BIT then
  1932. failed := true;
  1933. if object_u16bit <> RESULT_U16BIT then
  1934. failed := true;
  1935. if object_s32bit <> RESULT_S32BIT then
  1936. failed := true;
  1937. if object_s64bit <> RESULT_S64BIT then
  1938. failed := true;
  1939. if object_bigstring <> RESULT_BIGSTRING then
  1940. failed := true;
  1941. destructor_params_done;
  1942. if failed then
  1943. fail
  1944. else
  1945. Writeln('Passed!');
  1946. clear_globals;
  1947. clear_values;
  1948. failed := false;
  1949. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  1950. value_u8bit := RESULT_U8BIT;
  1951. value_u16bit := RESULT_U16BIT;
  1952. value_bigstring := RESULT_BIGSTRING;
  1953. value_s32bit := RESULT_S32BIT;
  1954. value_s64bit := RESULT_S64BIT;
  1955. constructor_params_mixed_call_overriden(value_u8bit,
  1956. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1957. if object_u8bit <> RESULT_U8BIT then
  1958. failed := true;
  1959. if object_u16bit <> RESULT_U16BIT then
  1960. failed := true;
  1961. if object_s32bit <> RESULT_S32BIT then
  1962. failed := true;
  1963. if object_s64bit <> RESULT_S64BIT then
  1964. failed := true;
  1965. if object_bigstring <> RESULT_BIGSTRING then
  1966. failed := true;
  1967. destructor_params_done;
  1968. if failed then
  1969. fail
  1970. else
  1971. Writeln('Passed!');
  1972. clear_globals;
  1973. clear_values;
  1974. failed := false;
  1975. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
  1976. constructor_params_mixed_call_normal(RESULT_U8BIT,
  1977. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1978. if object_u8bit <> RESULT_U8BIT then
  1979. failed := true;
  1980. if object_u16bit <> RESULT_U16BIT then
  1981. failed := true;
  1982. if object_s32bit <> RESULT_S32BIT then
  1983. failed := true;
  1984. if object_s64bit <> RESULT_S64BIT then
  1985. failed := true;
  1986. if object_bigstring <> RESULT_BIGSTRING then
  1987. failed := true;
  1988. destructor_params_done;
  1989. if failed then
  1990. fail
  1991. else
  1992. Writeln('Passed!');
  1993. clear_globals;
  1994. clear_values;
  1995. failed := false;
  1996. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
  1997. value_u8bit := RESULT_U8BIT;
  1998. value_u16bit := RESULT_U16BIT;
  1999. value_bigstring := RESULT_BIGSTRING;
  2000. value_s32bit := RESULT_S32BIT;
  2001. value_s64bit := RESULT_S64BIT;
  2002. constructor_params_mixed_call_normal(value_u8bit,
  2003. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2004. if object_u8bit <> RESULT_U8BIT then
  2005. failed := true;
  2006. if object_u16bit <> RESULT_U16BIT then
  2007. failed := true;
  2008. if object_s32bit <> RESULT_S32BIT then
  2009. failed := true;
  2010. if object_s64bit <> RESULT_S64BIT then
  2011. failed := true;
  2012. if object_bigstring <> RESULT_BIGSTRING then
  2013. failed := true;
  2014. destructor_params_done;
  2015. if failed then
  2016. fail
  2017. else
  2018. Writeln('Passed!');
  2019. clear_globals;
  2020. clear_values;
  2021. failed := false;
  2022. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
  2023. constructor_params_mixed_call_static(RESULT_U8BIT,
  2024. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2025. if global_u8bit <> RESULT_U8BIT then
  2026. failed := true;
  2027. if global_u16bit <> RESULT_U16BIT then
  2028. failed := true;
  2029. if global_s32bit <> RESULT_S32BIT then
  2030. failed := true;
  2031. if global_s64bit <> RESULT_S64BIT then
  2032. failed := true;
  2033. if global_bigstring <> RESULT_BIGSTRING then
  2034. failed := true;
  2035. destructor_params_done;
  2036. if failed then
  2037. fail
  2038. else
  2039. Writeln('Passed!');
  2040. clear_globals;
  2041. clear_values;
  2042. failed := false;
  2043. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
  2044. value_u8bit := RESULT_U8BIT;
  2045. value_u16bit := RESULT_U16BIT;
  2046. value_bigstring := RESULT_BIGSTRING;
  2047. value_s32bit := RESULT_S32BIT;
  2048. value_s64bit := RESULT_S64BIT;
  2049. constructor_params_mixed_call_static(value_u8bit,
  2050. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2051. if global_u8bit <> RESULT_U8BIT then
  2052. failed := true;
  2053. if global_u16bit <> RESULT_U16BIT then
  2054. failed := true;
  2055. if global_s32bit <> RESULT_S32BIT then
  2056. failed := true;
  2057. if global_s64bit <> RESULT_S64BIT then
  2058. failed := true;
  2059. if global_bigstring <> RESULT_BIGSTRING then
  2060. failed := true;
  2061. destructor_params_done;
  2062. if failed then
  2063. fail
  2064. else
  2065. Writeln('Passed!');
  2066. {************************* METHOD TESTING **************************}
  2067. clear_globals;
  2068. clear_values;
  2069. failed := false;
  2070. constructor_init;
  2071. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  2072. method_virtual_params_mixed(RESULT_U8BIT,
  2073. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2074. if object_u8bit <> RESULT_U8BIT then
  2075. failed := true;
  2076. if object_u16bit <> RESULT_U16BIT then
  2077. failed := true;
  2078. if object_s32bit <> RESULT_S32BIT then
  2079. failed := true;
  2080. if object_s64bit <> RESULT_S64BIT then
  2081. failed := true;
  2082. if object_bigstring <> RESULT_BIGSTRING then
  2083. failed := true;
  2084. destructor_params_done;
  2085. if failed then
  2086. fail
  2087. else
  2088. Writeln('Passed!');
  2089. clear_globals;
  2090. clear_values;
  2091. failed := false;
  2092. constructor_init;
  2093. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  2094. value_u8bit := RESULT_U8BIT;
  2095. value_u16bit := RESULT_U16BIT;
  2096. value_bigstring := RESULT_BIGSTRING;
  2097. value_s32bit := RESULT_S32BIT;
  2098. value_s64bit := RESULT_S64BIT;
  2099. method_virtual_params_mixed(value_u8bit,
  2100. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2101. if object_u8bit <> RESULT_U8BIT then
  2102. failed := true;
  2103. if object_u16bit <> RESULT_U16BIT then
  2104. failed := true;
  2105. if object_s32bit <> RESULT_S32BIT then
  2106. failed := true;
  2107. if object_s64bit <> RESULT_S64BIT then
  2108. failed := true;
  2109. if object_bigstring <> RESULT_BIGSTRING then
  2110. failed := true;
  2111. destructor_params_done;
  2112. if failed then
  2113. fail
  2114. else
  2115. Writeln('Passed!');
  2116. clear_globals;
  2117. clear_values;
  2118. failed := false;
  2119. constructor_init;
  2120. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  2121. method_virtual_overriden_params_mixed(RESULT_U8BIT,
  2122. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2123. if object_u8bit <> RESULT_U8BIT then
  2124. failed := true;
  2125. if object_u16bit <> RESULT_U16BIT then
  2126. failed := true;
  2127. if object_s32bit <> RESULT_S32BIT then
  2128. failed := true;
  2129. if object_s64bit <> RESULT_S64BIT then
  2130. failed := true;
  2131. if object_bigstring <> RESULT_BIGSTRING then
  2132. failed := true;
  2133. destructor_params_done;
  2134. if failed then
  2135. fail
  2136. else
  2137. Writeln('Passed!');
  2138. clear_globals;
  2139. clear_values;
  2140. failed := false;
  2141. constructor_init;
  2142. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  2143. value_u8bit := RESULT_U8BIT;
  2144. value_u16bit := RESULT_U16BIT;
  2145. value_bigstring := RESULT_BIGSTRING;
  2146. value_s32bit := RESULT_S32BIT;
  2147. value_s64bit := RESULT_S64BIT;
  2148. method_virtual_overriden_params_mixed(value_u8bit,
  2149. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2150. if object_u8bit <> RESULT_U8BIT then
  2151. failed := true;
  2152. if object_u16bit <> RESULT_U16BIT then
  2153. failed := true;
  2154. if object_s32bit <> RESULT_S32BIT then
  2155. failed := true;
  2156. if object_s64bit <> RESULT_S64BIT then
  2157. failed := true;
  2158. if object_bigstring <> RESULT_BIGSTRING then
  2159. failed := true;
  2160. destructor_params_done;
  2161. if failed then
  2162. fail
  2163. else
  2164. Writeln('Passed!');
  2165. clear_globals;
  2166. clear_values;
  2167. failed := false;
  2168. constructor_init;
  2169. Write('Testing mixed parameter (LOC_CONSTANT) method call...');
  2170. method_normal_params_mixed(RESULT_U8BIT,
  2171. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2172. if object_u8bit <> RESULT_U8BIT then
  2173. failed := true;
  2174. if object_u16bit <> RESULT_U16BIT then
  2175. failed := true;
  2176. if object_s32bit <> RESULT_S32BIT then
  2177. failed := true;
  2178. if object_s64bit <> RESULT_S64BIT then
  2179. failed := true;
  2180. if object_bigstring <> RESULT_BIGSTRING then
  2181. failed := true;
  2182. destructor_params_done;
  2183. if failed then
  2184. fail
  2185. else
  2186. Writeln('Passed!');
  2187. clear_globals;
  2188. clear_values;
  2189. failed := false;
  2190. constructor_init;
  2191. Write('Testing mixed parameter (LOC_REFERENCE) method call...');
  2192. value_u8bit := RESULT_U8BIT;
  2193. value_u16bit := RESULT_U16BIT;
  2194. value_bigstring := RESULT_BIGSTRING;
  2195. value_s32bit := RESULT_S32BIT;
  2196. value_s64bit := RESULT_S64BIT;
  2197. method_normal_params_mixed(value_u8bit,
  2198. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2199. if object_u8bit <> RESULT_U8BIT then
  2200. failed := true;
  2201. if object_u16bit <> RESULT_U16BIT then
  2202. failed := true;
  2203. if object_s32bit <> RESULT_S32BIT then
  2204. failed := true;
  2205. if object_s64bit <> RESULT_S64BIT then
  2206. failed := true;
  2207. if object_bigstring <> RESULT_BIGSTRING then
  2208. failed := true;
  2209. destructor_params_done;
  2210. if failed then
  2211. fail
  2212. else
  2213. Writeln('Passed!');
  2214. clear_globals;
  2215. clear_values;
  2216. failed := false;
  2217. constructor_init;
  2218. Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
  2219. method_static_params_mixed(RESULT_U8BIT,
  2220. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2221. if global_u8bit <> RESULT_U8BIT then
  2222. failed := true;
  2223. if global_u16bit <> RESULT_U16BIT then
  2224. failed := true;
  2225. if global_s32bit <> RESULT_S32BIT then
  2226. failed := true;
  2227. if global_s64bit <> RESULT_S64BIT then
  2228. failed := true;
  2229. if global_bigstring <> RESULT_BIGSTRING then
  2230. failed := true;
  2231. destructor_params_done;
  2232. if failed then
  2233. fail
  2234. else
  2235. Writeln('Passed!');
  2236. clear_globals;
  2237. clear_values;
  2238. failed := false;
  2239. constructor_init;
  2240. Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
  2241. value_u8bit := RESULT_U8BIT;
  2242. value_u16bit := RESULT_U16BIT;
  2243. value_bigstring := RESULT_BIGSTRING;
  2244. value_s32bit := RESULT_S32BIT;
  2245. value_s64bit := RESULT_S64BIT;
  2246. method_static_params_mixed(value_u8bit,
  2247. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2248. if global_u8bit <> RESULT_U8BIT then
  2249. failed := true;
  2250. if global_u16bit <> RESULT_U16BIT then
  2251. failed := true;
  2252. if global_s32bit <> RESULT_S32BIT then
  2253. failed := true;
  2254. if global_s64bit <> RESULT_S64BIT then
  2255. failed := true;
  2256. if global_bigstring <> RESULT_BIGSTRING then
  2257. failed := true;
  2258. destructor_params_done;
  2259. if failed then
  2260. fail
  2261. else
  2262. Writeln('Passed!');
  2263. { ********************************************************************
  2264. This calls methods which in turn call other methods, or a constructor
  2265. or a destructor.
  2266. *********************************************************************
  2267. }
  2268. clear_globals;
  2269. clear_values;
  2270. failed := false;
  2271. { Calls the ancestor virtual method }
  2272. constructor_init;
  2273. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  2274. method_normal_call_virtual_params_mixed(RESULT_U8BIT,
  2275. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2276. if object_u8bit <> RESULT_U8BIT then
  2277. failed := true;
  2278. if object_u16bit <> RESULT_U16BIT then
  2279. failed := true;
  2280. if object_s32bit <> RESULT_S32BIT then
  2281. failed := true;
  2282. if object_s64bit <> RESULT_S64BIT then
  2283. failed := true;
  2284. if object_bigstring <> RESULT_BIGSTRING then
  2285. failed := true;
  2286. destructor_params_done;
  2287. if failed then
  2288. fail
  2289. else
  2290. Writeln('Passed!');
  2291. clear_globals;
  2292. clear_values;
  2293. failed := false;
  2294. constructor_init;
  2295. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  2296. value_u8bit := RESULT_U8BIT;
  2297. value_u16bit := RESULT_U16BIT;
  2298. value_bigstring := RESULT_BIGSTRING;
  2299. value_s32bit := RESULT_S32BIT;
  2300. value_s64bit := RESULT_S64BIT;
  2301. method_normal_call_virtual_params_mixed(value_u8bit,
  2302. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2303. if object_u8bit <> RESULT_U8BIT then
  2304. failed := true;
  2305. if object_u16bit <> RESULT_U16BIT then
  2306. failed := true;
  2307. if object_s32bit <> RESULT_S32BIT then
  2308. failed := true;
  2309. if object_s64bit <> RESULT_S64BIT then
  2310. failed := true;
  2311. if object_bigstring <> RESULT_BIGSTRING then
  2312. failed := true;
  2313. destructor_params_done;
  2314. if failed then
  2315. fail
  2316. else
  2317. Writeln('Passed!');
  2318. { The virtual method has been overriden by the object in this case }
  2319. constructor_init;
  2320. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  2321. method_normal_call_overriden_params_mixed(RESULT_U8BIT,
  2322. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2323. if object_u8bit <> RESULT_U8BIT then
  2324. failed := true;
  2325. if object_u16bit <> RESULT_U16BIT then
  2326. failed := true;
  2327. if object_s32bit <> RESULT_S32BIT then
  2328. failed := true;
  2329. if object_s64bit <> RESULT_S64BIT then
  2330. failed := true;
  2331. if object_bigstring <> RESULT_BIGSTRING then
  2332. failed := true;
  2333. destructor_params_done;
  2334. if failed then
  2335. fail
  2336. else
  2337. Writeln('Passed!');
  2338. clear_globals;
  2339. clear_values;
  2340. failed := false;
  2341. constructor_init;
  2342. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  2343. value_u8bit := RESULT_U8BIT;
  2344. value_u16bit := RESULT_U16BIT;
  2345. value_bigstring := RESULT_BIGSTRING;
  2346. value_s32bit := RESULT_S32BIT;
  2347. value_s64bit := RESULT_S64BIT;
  2348. method_normal_call_overriden_params_mixed(value_u8bit,
  2349. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2350. if object_u8bit <> RESULT_U8BIT then
  2351. failed := true;
  2352. if object_u16bit <> RESULT_U16BIT then
  2353. failed := true;
  2354. if object_s32bit <> RESULT_S32BIT then
  2355. failed := true;
  2356. if object_s64bit <> RESULT_S64BIT then
  2357. failed := true;
  2358. if object_bigstring <> RESULT_BIGSTRING then
  2359. failed := true;
  2360. destructor_params_done;
  2361. if failed then
  2362. fail
  2363. else
  2364. Writeln('Passed!');
  2365. clear_globals;
  2366. clear_values;
  2367. failed := false;
  2368. constructor_init;
  2369. Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
  2370. method_normal_call_normal_params_mixed(RESULT_U8BIT,
  2371. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2372. if object_u8bit <> RESULT_U8BIT then
  2373. failed := true;
  2374. if object_u16bit <> RESULT_U16BIT then
  2375. failed := true;
  2376. if object_s32bit <> RESULT_S32BIT then
  2377. failed := true;
  2378. if object_s64bit <> RESULT_S64BIT then
  2379. failed := true;
  2380. if object_bigstring <> RESULT_BIGSTRING then
  2381. failed := true;
  2382. destructor_params_done;
  2383. if failed then
  2384. fail
  2385. else
  2386. Writeln('Passed!');
  2387. clear_globals;
  2388. clear_values;
  2389. failed := false;
  2390. constructor_init;
  2391. Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
  2392. value_u8bit := RESULT_U8BIT;
  2393. value_u16bit := RESULT_U16BIT;
  2394. value_bigstring := RESULT_BIGSTRING;
  2395. value_s32bit := RESULT_S32BIT;
  2396. value_s64bit := RESULT_S64BIT;
  2397. method_normal_call_normal_params_mixed(value_u8bit,
  2398. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2399. if object_u8bit <> RESULT_U8BIT then
  2400. failed := true;
  2401. if object_u16bit <> RESULT_U16BIT then
  2402. failed := true;
  2403. if object_s32bit <> RESULT_S32BIT then
  2404. failed := true;
  2405. if object_s64bit <> RESULT_S64BIT then
  2406. failed := true;
  2407. if object_bigstring <> RESULT_BIGSTRING then
  2408. failed := true;
  2409. destructor_params_done;
  2410. if failed then
  2411. fail
  2412. else
  2413. Writeln('Passed!');
  2414. (* constructor call inside a normal method *)
  2415. clear_globals;
  2416. clear_values;
  2417. failed := false;
  2418. constructor_init;
  2419. Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
  2420. method_normal_call_constructor_params_mixed(RESULT_U8BIT,
  2421. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2422. if object_u8bit <> RESULT_U8BIT then
  2423. failed := true;
  2424. if object_u16bit <> RESULT_U16BIT then
  2425. failed := true;
  2426. if object_s32bit <> RESULT_S32BIT then
  2427. failed := true;
  2428. if object_s64bit <> RESULT_S64BIT then
  2429. failed := true;
  2430. if object_bigstring <> RESULT_BIGSTRING then
  2431. failed := true;
  2432. destructor_params_done;
  2433. if failed then
  2434. fail
  2435. else
  2436. Writeln('Passed!');
  2437. clear_globals;
  2438. clear_values;
  2439. failed := false;
  2440. constructor_init;
  2441. Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
  2442. value_u8bit := RESULT_U8BIT;
  2443. value_u16bit := RESULT_U16BIT;
  2444. value_bigstring := RESULT_BIGSTRING;
  2445. value_s32bit := RESULT_S32BIT;
  2446. value_s64bit := RESULT_S64BIT;
  2447. method_normal_call_constructor_params_mixed(value_u8bit,
  2448. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2449. if object_u8bit <> RESULT_U8BIT then
  2450. failed := true;
  2451. if object_u16bit <> RESULT_U16BIT then
  2452. failed := true;
  2453. if object_s32bit <> RESULT_S32BIT then
  2454. failed := true;
  2455. if object_s64bit <> RESULT_S64BIT then
  2456. failed := true;
  2457. if object_bigstring <> RESULT_BIGSTRING then
  2458. failed := true;
  2459. destructor_params_done;
  2460. if failed then
  2461. fail
  2462. else
  2463. Writeln('Passed!');
  2464. { static method call }
  2465. clear_globals;
  2466. clear_values;
  2467. failed := false;
  2468. constructor_init;
  2469. Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
  2470. method_normal_call_static_params_mixed(RESULT_U8BIT,
  2471. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2472. if global_u8bit <> RESULT_U8BIT then
  2473. failed := true;
  2474. if global_u16bit <> RESULT_U16BIT then
  2475. failed := true;
  2476. if global_s32bit <> RESULT_S32BIT then
  2477. failed := true;
  2478. if global_s64bit <> RESULT_S64BIT then
  2479. failed := true;
  2480. if global_bigstring <> RESULT_BIGSTRING then
  2481. failed := true;
  2482. destructor_params_done;
  2483. if failed then
  2484. fail
  2485. else
  2486. Writeln('Passed!');
  2487. clear_globals;
  2488. clear_values;
  2489. failed := false;
  2490. constructor_init;
  2491. Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
  2492. value_u8bit := RESULT_U8BIT;
  2493. value_u16bit := RESULT_U16BIT;
  2494. value_bigstring := RESULT_BIGSTRING;
  2495. value_s32bit := RESULT_S32BIT;
  2496. value_s64bit := RESULT_S64BIT;
  2497. method_normal_call_static_params_mixed(value_u8bit,
  2498. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2499. if global_u8bit <> RESULT_U8BIT then
  2500. failed := true;
  2501. if global_u16bit <> RESULT_U16BIT then
  2502. failed := true;
  2503. if global_s32bit <> RESULT_S32BIT then
  2504. failed := true;
  2505. if global_s64bit <> RESULT_S64BIT then
  2506. failed := true;
  2507. if global_bigstring <> RESULT_BIGSTRING then
  2508. failed := true;
  2509. destructor_params_done;
  2510. if failed then
  2511. fail
  2512. else
  2513. Writeln('Passed!');
  2514. (* calls the inherited method *)
  2515. clear_globals;
  2516. clear_values;
  2517. failed := false;
  2518. { Calls the ancestor virtual method }
  2519. constructor_init;
  2520. Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
  2521. method_normal_call_inherited_params_mixed(RESULT_U8BIT,
  2522. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2523. if object_u8bit <> RESULT_U8BIT then
  2524. failed := true;
  2525. if object_u16bit <> RESULT_U16BIT then
  2526. failed := true;
  2527. if object_s32bit <> RESULT_S32BIT then
  2528. failed := true;
  2529. if object_s64bit <> RESULT_S64BIT then
  2530. failed := true;
  2531. if object_bigstring <> RESULT_BIGSTRING then
  2532. failed := true;
  2533. destructor_params_done;
  2534. if failed then
  2535. fail
  2536. else
  2537. Writeln('Passed!');
  2538. clear_globals;
  2539. clear_values;
  2540. failed := false;
  2541. constructor_init;
  2542. Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
  2543. value_u8bit := RESULT_U8BIT;
  2544. value_u16bit := RESULT_U16BIT;
  2545. value_bigstring := RESULT_BIGSTRING;
  2546. value_s32bit := RESULT_S32BIT;
  2547. value_s64bit := RESULT_S64BIT;
  2548. method_normal_call_inherited_params_mixed(value_u8bit,
  2549. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2550. if object_u8bit <> RESULT_U8BIT then
  2551. failed := true;
  2552. if object_u16bit <> RESULT_U16BIT then
  2553. failed := true;
  2554. if object_s32bit <> RESULT_S32BIT then
  2555. failed := true;
  2556. if object_s64bit <> RESULT_S64BIT then
  2557. failed := true;
  2558. if object_bigstring <> RESULT_BIGSTRING then
  2559. failed := true;
  2560. destructor_params_done;
  2561. if failed then
  2562. fail
  2563. else
  2564. Writeln('Passed!');
  2565. { ********************************************************************
  2566. This calls virtual methods which in turn call other methods,
  2567. or a constructor or a destructor.
  2568. *********************************************************************
  2569. }
  2570. clear_globals;
  2571. clear_values;
  2572. failed := false;
  2573. { Calls the ancestor virtual method }
  2574. constructor_init;
  2575. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  2576. method_virtual_call_virtual_params_mixed(RESULT_U8BIT,
  2577. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2578. if object_u8bit <> RESULT_U8BIT then
  2579. failed := true;
  2580. if object_u16bit <> RESULT_U16BIT then
  2581. failed := true;
  2582. if object_s32bit <> RESULT_S32BIT then
  2583. failed := true;
  2584. if object_s64bit <> RESULT_S64BIT then
  2585. failed := true;
  2586. if object_bigstring <> RESULT_BIGSTRING then
  2587. failed := true;
  2588. destructor_params_done;
  2589. if failed then
  2590. fail
  2591. else
  2592. Writeln('Passed!');
  2593. clear_globals;
  2594. clear_values;
  2595. failed := false;
  2596. constructor_init;
  2597. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  2598. value_u8bit := RESULT_U8BIT;
  2599. value_u16bit := RESULT_U16BIT;
  2600. value_bigstring := RESULT_BIGSTRING;
  2601. value_s32bit := RESULT_S32BIT;
  2602. value_s64bit := RESULT_S64BIT;
  2603. method_virtual_call_virtual_params_mixed(value_u8bit,
  2604. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2605. if object_u8bit <> RESULT_U8BIT then
  2606. failed := true;
  2607. if object_u16bit <> RESULT_U16BIT then
  2608. failed := true;
  2609. if object_s32bit <> RESULT_S32BIT then
  2610. failed := true;
  2611. if object_s64bit <> RESULT_S64BIT then
  2612. failed := true;
  2613. if object_bigstring <> RESULT_BIGSTRING then
  2614. failed := true;
  2615. destructor_params_done;
  2616. if failed then
  2617. fail
  2618. else
  2619. Writeln('Passed!');
  2620. { The virtual method has been overriden by the object in this case }
  2621. constructor_init;
  2622. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  2623. method_virtual_call_overriden_params_mixed(RESULT_U8BIT,
  2624. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2625. if object_u8bit <> RESULT_U8BIT then
  2626. failed := true;
  2627. if object_u16bit <> RESULT_U16BIT then
  2628. failed := true;
  2629. if object_s32bit <> RESULT_S32BIT then
  2630. failed := true;
  2631. if object_s64bit <> RESULT_S64BIT then
  2632. failed := true;
  2633. if object_bigstring <> RESULT_BIGSTRING then
  2634. failed := true;
  2635. destructor_params_done;
  2636. if failed then
  2637. fail
  2638. else
  2639. Writeln('Passed!');
  2640. clear_globals;
  2641. clear_values;
  2642. failed := false;
  2643. constructor_init;
  2644. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  2645. value_u8bit := RESULT_U8BIT;
  2646. value_u16bit := RESULT_U16BIT;
  2647. value_bigstring := RESULT_BIGSTRING;
  2648. value_s32bit := RESULT_S32BIT;
  2649. value_s64bit := RESULT_S64BIT;
  2650. method_virtual_call_overriden_params_mixed(value_u8bit,
  2651. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2652. if object_u8bit <> RESULT_U8BIT then
  2653. failed := true;
  2654. if object_u16bit <> RESULT_U16BIT then
  2655. failed := true;
  2656. if object_s32bit <> RESULT_S32BIT then
  2657. failed := true;
  2658. if object_s64bit <> RESULT_S64BIT then
  2659. failed := true;
  2660. if object_bigstring <> RESULT_BIGSTRING then
  2661. failed := true;
  2662. destructor_params_done;
  2663. if failed then
  2664. fail
  2665. else
  2666. Writeln('Passed!');
  2667. clear_globals;
  2668. clear_values;
  2669. failed := false;
  2670. constructor_init;
  2671. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
  2672. method_virtual_call_normal_params_mixed(RESULT_U8BIT,
  2673. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2674. if object_u8bit <> RESULT_U8BIT then
  2675. failed := true;
  2676. if object_u16bit <> RESULT_U16BIT then
  2677. failed := true;
  2678. if object_s32bit <> RESULT_S32BIT then
  2679. failed := true;
  2680. if object_s64bit <> RESULT_S64BIT then
  2681. failed := true;
  2682. if object_bigstring <> RESULT_BIGSTRING then
  2683. failed := true;
  2684. destructor_params_done;
  2685. if failed then
  2686. fail
  2687. else
  2688. Writeln('Passed!');
  2689. clear_globals;
  2690. clear_values;
  2691. failed := false;
  2692. constructor_init;
  2693. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
  2694. value_u8bit := RESULT_U8BIT;
  2695. value_u16bit := RESULT_U16BIT;
  2696. value_bigstring := RESULT_BIGSTRING;
  2697. value_s32bit := RESULT_S32BIT;
  2698. value_s64bit := RESULT_S64BIT;
  2699. method_virtual_call_normal_params_mixed(value_u8bit,
  2700. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2701. if object_u8bit <> RESULT_U8BIT then
  2702. failed := true;
  2703. if object_u16bit <> RESULT_U16BIT then
  2704. failed := true;
  2705. if object_s32bit <> RESULT_S32BIT then
  2706. failed := true;
  2707. if object_s64bit <> RESULT_S64BIT then
  2708. failed := true;
  2709. if object_bigstring <> RESULT_BIGSTRING then
  2710. failed := true;
  2711. destructor_params_done;
  2712. if failed then
  2713. fail
  2714. else
  2715. Writeln('Passed!');
  2716. (* constructor call inside a normal method *)
  2717. clear_globals;
  2718. clear_values;
  2719. failed := false;
  2720. constructor_init;
  2721. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
  2722. method_virtual_call_constructor_params_mixed(RESULT_U8BIT,
  2723. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2724. if object_u8bit <> RESULT_U8BIT then
  2725. failed := true;
  2726. if object_u16bit <> RESULT_U16BIT then
  2727. failed := true;
  2728. if object_s32bit <> RESULT_S32BIT then
  2729. failed := true;
  2730. if object_s64bit <> RESULT_S64BIT then
  2731. failed := true;
  2732. if object_bigstring <> RESULT_BIGSTRING then
  2733. failed := true;
  2734. destructor_params_done;
  2735. if failed then
  2736. fail
  2737. else
  2738. Writeln('Passed!');
  2739. clear_globals;
  2740. clear_values;
  2741. failed := false;
  2742. constructor_init;
  2743. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
  2744. value_u8bit := RESULT_U8BIT;
  2745. value_u16bit := RESULT_U16BIT;
  2746. value_bigstring := RESULT_BIGSTRING;
  2747. value_s32bit := RESULT_S32BIT;
  2748. value_s64bit := RESULT_S64BIT;
  2749. method_virtual_call_constructor_params_mixed(value_u8bit,
  2750. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2751. if object_u8bit <> RESULT_U8BIT then
  2752. failed := true;
  2753. if object_u16bit <> RESULT_U16BIT then
  2754. failed := true;
  2755. if object_s32bit <> RESULT_S32BIT then
  2756. failed := true;
  2757. if object_s64bit <> RESULT_S64BIT then
  2758. failed := true;
  2759. if object_bigstring <> RESULT_BIGSTRING then
  2760. failed := true;
  2761. destructor_params_done;
  2762. if failed then
  2763. fail
  2764. else
  2765. Writeln('Passed!');
  2766. { static virtual call }
  2767. clear_globals;
  2768. clear_values;
  2769. failed := false;
  2770. constructor_init;
  2771. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
  2772. method_virtual_call_static_params_mixed(RESULT_U8BIT,
  2773. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2774. if global_u8bit <> RESULT_U8BIT then
  2775. failed := true;
  2776. if global_u16bit <> RESULT_U16BIT then
  2777. failed := true;
  2778. if global_s32bit <> RESULT_S32BIT then
  2779. failed := true;
  2780. if global_s64bit <> RESULT_S64BIT then
  2781. failed := true;
  2782. if global_bigstring <> RESULT_BIGSTRING then
  2783. failed := true;
  2784. destructor_params_done;
  2785. if failed then
  2786. fail
  2787. else
  2788. Writeln('Passed!');
  2789. clear_globals;
  2790. clear_values;
  2791. failed := false;
  2792. constructor_init;
  2793. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
  2794. value_u8bit := RESULT_U8BIT;
  2795. value_u16bit := RESULT_U16BIT;
  2796. value_bigstring := RESULT_BIGSTRING;
  2797. value_s32bit := RESULT_S32BIT;
  2798. value_s64bit := RESULT_S64BIT;
  2799. method_virtual_call_static_params_mixed(value_u8bit,
  2800. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2801. if global_u8bit <> RESULT_U8BIT then
  2802. failed := true;
  2803. if global_u16bit <> RESULT_U16BIT then
  2804. failed := true;
  2805. if global_s32bit <> RESULT_S32BIT then
  2806. failed := true;
  2807. if global_s64bit <> RESULT_S64BIT then
  2808. failed := true;
  2809. if global_bigstring <> RESULT_BIGSTRING then
  2810. failed := true;
  2811. destructor_params_done;
  2812. if failed then
  2813. fail
  2814. else
  2815. Writeln('Passed!');
  2816. (* calls the inherited method *)
  2817. clear_globals;
  2818. clear_values;
  2819. failed := false;
  2820. { Calls the ancestor virtual method }
  2821. constructor_init;
  2822. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
  2823. method_virtual_call_inherited_params_mixed(RESULT_U8BIT,
  2824. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2825. if object_u8bit <> RESULT_U8BIT then
  2826. failed := true;
  2827. if object_u16bit <> RESULT_U16BIT then
  2828. failed := true;
  2829. if object_s32bit <> RESULT_S32BIT then
  2830. failed := true;
  2831. if object_s64bit <> RESULT_S64BIT then
  2832. failed := true;
  2833. if object_bigstring <> RESULT_BIGSTRING then
  2834. failed := true;
  2835. destructor_params_done;
  2836. if failed then
  2837. fail
  2838. else
  2839. Writeln('Passed!');
  2840. clear_globals;
  2841. clear_values;
  2842. failed := false;
  2843. constructor_init;
  2844. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
  2845. value_u8bit := RESULT_U8BIT;
  2846. value_u16bit := RESULT_U16BIT;
  2847. value_bigstring := RESULT_BIGSTRING;
  2848. value_s32bit := RESULT_S32BIT;
  2849. value_s64bit := RESULT_S64BIT;
  2850. method_virtual_call_inherited_params_mixed(value_u8bit,
  2851. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2852. if object_u8bit <> RESULT_U8BIT then
  2853. failed := true;
  2854. if object_u16bit <> RESULT_U16BIT then
  2855. failed := true;
  2856. if object_s32bit <> RESULT_S32BIT then
  2857. failed := true;
  2858. if object_s64bit <> RESULT_S64BIT then
  2859. failed := true;
  2860. if object_bigstring <> RESULT_BIGSTRING then
  2861. failed := true;
  2862. destructor_params_done;
  2863. if failed then
  2864. fail
  2865. else
  2866. Writeln('Passed!');
  2867. end; { end with }
  2868. end;
  2869. begin
  2870. WriteLN('*********************** NO VMT OBJECT TESTS ********************');
  2871. testnovmtobject;
  2872. WriteLN('************************ VMT OBJECT FAIL **********************');
  2873. testfailedobject;
  2874. WriteLN('************************* VMT OBJECT TESTS *********************');
  2875. testvmtobject;
  2876. testheritedvmtobject;
  2877. WriteLN('**************** VMT OBJECT TESTS USING WITH *******************');
  2878. testwith;
  2879. end.