tcalcla1.pp 121 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014
  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 classes with conventional calling }
  17. { conventions. }
  18. { }
  19. { REMARKS: dynamic method testing does not test all cases, }
  20. { this is done because it is assumed that the code generator }
  21. { generates the same code for both dynamic and virtual methods }
  22. {****************************************************************}
  23. program tcalcla1;
  24. {$STATIC ON}
  25. {$mode objfpc}
  26. {$R+}
  27. const
  28. { should be defined depending on CPU target }
  29. {$ifdef cpu68k}
  30. BIG_INDEX = 8000;
  31. SMALL_INDEX = 13;
  32. {$else}
  33. BIG_INDEX = 33000;
  34. SMALL_INDEX = 13; { value should not be aligned! }
  35. {$endif}
  36. RESULT_U8BIT = $55;
  37. RESULT_U16BIT = 2*RESULT_U8BIT;
  38. RESULT_S32BIT = $500F0000;
  39. RESULT_S64BIT = $500F0000;
  40. RESULT_S32REAL = 1777.12;
  41. RESULT_S64REAL = 3444.24;
  42. RESULT_BOOL8BIT = 1;
  43. RESULT_BOOL16BIT = 1;
  44. RESULT_BOOL32BIT = 1;
  45. RESULT_PCHAR = 'Hello world';
  46. RESULT_BIGSTRING = 'Hello world';
  47. RESULT_SMALLSTRING = 'H';
  48. RESULT_CHAR = 'I';
  49. RESULT_BOOLEAN = TRUE;
  50. type
  51. tprocedure = procedure;
  52. tsmallrecord = packed record
  53. b: byte;
  54. w: word;
  55. end;
  56. tlargerecord = packed record
  57. b: array[1..BIG_INDEX] of byte;
  58. end;
  59. tsmallarray = packed array[1..SMALL_INDEX] of byte;
  60. tsmallsetenum =
  61. (A_A,A_B,A_C,A_D);
  62. tsmallset = set of tsmallsetenum;
  63. tlargeset = set of char;
  64. tsmallstring = string[2];
  65. var
  66. global_u8bit : byte;
  67. global_u16bit : word;
  68. global_s32bit : longint;
  69. global_s32real : single;
  70. global_s64real : double;
  71. global_ptr : pchar;
  72. global_proc : tprocedure;
  73. global_bigstring : shortstring;
  74. global_boolean : boolean;
  75. global_char : char;
  76. global_s64bit : int64;
  77. value_s64bit : int64;
  78. value_ansistring : ansistring;
  79. value_u8bit : byte;
  80. value_u16bit : word;
  81. value_s32bit : longint;
  82. value_s32real : single;
  83. value_s64real : double;
  84. value_proc : tprocedure;
  85. value_ptr : pchar;
  86. value_smallrec : tsmallrecord;
  87. value_largerec : tlargerecord;
  88. value_smallset : tsmallset;
  89. value_smallstring : tsmallstring;
  90. value_bigstring : shortstring;
  91. value_largeset : tlargeset;
  92. value_smallarray : tsmallarray;
  93. value_boolean : boolean;
  94. value_char : char;
  95. procedure fail;
  96. begin
  97. WriteLn('Failure.');
  98. halt(1);
  99. end;
  100. procedure clear_globals;
  101. begin
  102. global_u8bit := 0;
  103. global_u16bit := 0;
  104. global_s32bit := 0;
  105. global_s32real := 0.0;
  106. global_s64real := 0.0;
  107. global_ptr := nil;
  108. global_proc := nil;
  109. global_bigstring := '';
  110. global_boolean := false;
  111. global_char := #0;
  112. global_s64bit := 0;
  113. end;
  114. procedure clear_values;
  115. begin
  116. value_u8bit := 0;
  117. value_u16bit := 0;
  118. value_s32bit := 0;
  119. value_s32real := 0.0;
  120. value_s64real := 0.0;
  121. value_proc := nil;
  122. value_ptr := nil;
  123. fillchar(value_smallrec, sizeof(value_smallrec), #0);
  124. fillchar(value_largerec, sizeof(value_largerec), #0);
  125. value_smallset := [];
  126. value_smallstring := '';
  127. value_bigstring := '';
  128. value_largeset := [];
  129. fillchar(value_smallarray, sizeof(value_smallarray), #0);
  130. value_boolean := false;
  131. value_char:=#0;
  132. value_ansistring := '';
  133. value_s64bit := 0;
  134. end;
  135. function getu8: byte;
  136. begin
  137. getu8 := RESULT_U8BIT;
  138. end;
  139. type
  140. { object without vmt }
  141. pnovmtclass = ^tnovmtclass;
  142. tnovmtclass = class
  143. public
  144. object_bigstring : shortstring;
  145. object_u16bit : word;
  146. { no parameter testing }
  147. procedure method_public_none;
  148. class procedure method_public_static_none;
  149. procedure method_call_private_none;
  150. class procedure method_call_private_static_none;
  151. { simple value parameter testing }
  152. procedure method_public_u8(x : byte);
  153. class procedure method_public_static_u8(x: byte);
  154. procedure method_call_private_u8(x: byte);
  155. class procedure method_call_private_static_u8(x: byte);
  156. function func_array_mixed_nested(b: byte): tsmallarray;
  157. private
  158. procedure method_private_none;
  159. class procedure method_private_static_none;
  160. function func_getu16bit : word;
  161. { simple value parameter testing }
  162. procedure method_private_u8(x: byte);
  163. class procedure method_private_static_u8(x: byte);
  164. end;
  165. { object with vmt }
  166. pvmtclass = ^tvmtclass;
  167. tvmtclass = class
  168. public
  169. object_u8bit : byte;
  170. object_u16bit : word;
  171. object_bigstring : shortstring;
  172. object_s32bit : longint;
  173. object_s64bit : int64;
  174. constructor constructor_params_mixed(u8 :byte; u16: word;
  175. bigstring: shortstring; s32: longint; s64: int64);
  176. constructor constructor_init;
  177. destructor destructor_params_done;
  178. procedure method_normal_params_mixed(u8 :byte; u16: word;
  179. bigstring: shortstring; s32: longint; s64: int64);
  180. procedure method_virtual_params_mixed(u8 :byte; u16: word;
  181. bigstring: shortstring; s32: longint; s64: int64);virtual;
  182. procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word;
  183. bigstring: shortstring; s32: longint; s64: int64);virtual;abstract;
  184. procedure method_dynamic_params_mixed(u8 :byte; u16: word;
  185. bigstring: shortstring; s32: longint; s64: int64);dynamic;
  186. procedure method_dynamic_overriden_params_mixed(u8 :byte; u16: word;
  187. bigstring: shortstring; s32: longint; s64: int64);dynamic;abstract;
  188. class procedure method_static_params_mixed(u8 :byte; u16: word;
  189. bigstring: shortstring; s32: longint; s64: int64);
  190. procedure method_normal_call_inherited_params_mixed(
  191. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  192. { virtual methods which call other methods }
  193. procedure method_virtual_call_static_params_mixed(
  194. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
  195. procedure method_virtual_call_virtual_params_mixed(
  196. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
  197. procedure method_virtual_call_overriden_params_mixed(
  198. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
  199. procedure method_virtual_call_normal_params_mixed(
  200. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
  201. procedure method_virtual_call_constructor_params_mixed(
  202. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
  203. procedure method_virtual_call_destructor; virtual;
  204. procedure method_virtual_call_inherited_params_mixed(
  205. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
  206. procedure method_dynamic_call_static_params_mixed(
  207. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);dynamic;
  208. procedure method_dynamic_call_virtual_params_mixed(
  209. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);dynamic;
  210. procedure method_dynamic_call_overriden_params_mixed(
  211. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);dynamic;
  212. procedure method_dynamic_call_normal_params_mixed(
  213. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);dynamic;
  214. procedure method_dynamic_call_constructor_params_mixed(
  215. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);dynamic;
  216. procedure method_dynamic_call_destructor;dynamic;
  217. procedure method_dynamic_call_inherited_params_mixed(
  218. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);dynamic;
  219. end;
  220. pheritedvmtclass = ^theritedvmtclass;
  221. theritedvmtclass = class(tvmtclass)
  222. constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word;
  223. bigstring: shortstring; s32: longint; s64: int64);
  224. constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word;
  225. bigstring: shortstring; s32: longint; s64: int64);
  226. constructor constructor_params_mixed_call_static(u8 :byte; u16: word;
  227. bigstring: shortstring; s32: longint; s64: int64);
  228. constructor constructor_params_mixed_call_normal(u8 :byte; u16: word;
  229. bigstring: shortstring; s32: longint; s64: int64);
  230. constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word;
  231. bigstring: shortstring; s32: longint; s64: int64);
  232. procedure method_virtual_overriden_params_mixed(
  233. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);override;
  234. procedure method_dynamic_overriden_params_mixed(
  235. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);override;
  236. { normal methods which call other methods }
  237. procedure method_normal_call_static_params_mixed(
  238. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  239. procedure method_normal_call_virtual_params_mixed(
  240. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  241. procedure method_normal_call_overriden_params_mixed(
  242. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  243. procedure method_normal_call_normal_params_mixed(
  244. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  245. procedure method_normal_call_constructor_params_mixed(
  246. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  247. procedure method_normal_call_inherited_params_mixed(
  248. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  249. { virtual methods which call other methods }
  250. procedure method_virtual_call_inherited_params_mixed(
  251. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);override;
  252. end;
  253. pfailvmtclass = ^tfailvmtclass;
  254. tfailvmtclass = class(tvmtclass)
  255. public
  256. constructor constructor_public_none;
  257. end;
  258. {**************************************************************************}
  259. { NO VMT OBJECT }
  260. {**************************************************************************}
  261. {****************** NO PARAMETERS ******************}
  262. procedure tnovmtclass.method_public_none;
  263. begin
  264. global_u8bit := RESULT_U8BIT;
  265. end;
  266. class procedure tnovmtclass.method_public_static_none;
  267. begin
  268. global_u8bit := RESULT_U8BIT;
  269. end;
  270. procedure tnovmtclass.method_call_private_none;
  271. begin
  272. method_private_none;
  273. method_private_static_none;
  274. end;
  275. class procedure tnovmtclass.method_call_private_static_none;
  276. begin
  277. method_private_static_none;
  278. end;
  279. procedure tnovmtclass.method_private_none;
  280. begin
  281. Inc(global_u16bit, RESULT_U8BIT);
  282. end;
  283. class procedure tnovmtclass.method_private_static_none;
  284. begin
  285. Inc(global_u16bit, RESULT_U8BIT);
  286. end;
  287. {******************** PARAMETERS ******************}
  288. procedure tnovmtclass.method_public_u8(x : byte);
  289. begin
  290. global_u8bit := x;
  291. end;
  292. class procedure tnovmtclass.method_public_static_u8(x: byte);
  293. begin
  294. global_u8bit := x;
  295. end;
  296. procedure tnovmtclass.method_call_private_u8(x: byte);
  297. begin
  298. method_private_static_u8(x);
  299. method_private_u8(x);
  300. end;
  301. class procedure tnovmtclass. method_call_private_static_u8(x: byte);
  302. begin
  303. method_private_static_u8(x);
  304. end;
  305. procedure tnovmtclass.method_private_u8(x: byte);
  306. begin
  307. Inc(global_u16bit,x);
  308. end;
  309. class procedure tnovmtclass.method_private_static_u8(x: byte);
  310. begin
  311. Inc(global_u16bit,x);
  312. end;
  313. function tnovmtclass.func_getu16bit : word;
  314. begin
  315. func_getu16bit := object_u16bit;
  316. end;
  317. {
  318. complex testing, nested field access, with parameters and
  319. comple return value.
  320. On exit : global_u8bit := x;
  321. global_u16bit := object_u16bit (from func_getu16bit);
  322. global_s32bit := RESULT_S32BIT
  323. global_bigstring := object_bigstring
  324. global_s64bit := x;
  325. }
  326. function tnovmtclass.func_array_mixed_nested(b: byte): tsmallarray;
  327. procedure nested_one_proc(l: longint);
  328. begin
  329. global_u16bit := func_getu16bit;
  330. global_s32bit := l;
  331. end;
  332. procedure nested_two_proc(l : longint);
  333. begin
  334. global_s64bit := l;
  335. end;
  336. function nested_one_func(level1_b : byte; s: shortstring): byte;
  337. var
  338. s1 : shortstring;
  339. function nested_two_func(level2_b : byte; s :shortstring): byte;
  340. begin
  341. nested_two_func:=level2_b;
  342. global_bigstring := s;
  343. nested_one_proc(RESULT_S32BIT);
  344. end;
  345. begin
  346. s1:=s;
  347. nested_one_func := nested_two_func(level1_b,s1);
  348. nested_two_proc(level1_b);
  349. end;
  350. var
  351. local_b: byte;
  352. smallarray: tsmallarray;
  353. begin
  354. fillchar(smallarray, sizeof(smallarray), #0);
  355. smallarray[1] := RESULT_U8BIT;
  356. smallarray[SMALL_INDEX] := RESULT_U8BIT;
  357. func_array_mixed_nested := smallarray;
  358. local_b:=b;
  359. global_u8bit := nested_one_func(local_b, object_bigstring);
  360. end;
  361. {**************************************************************************}
  362. { FAILED OBJECT }
  363. {**************************************************************************}
  364. constructor tfailvmtclass.constructor_public_none;
  365. begin
  366. { this calls the constructor fail special keyword }
  367. fail;
  368. end;
  369. {**************************************************************************}
  370. { VMT OBJECT }
  371. {**************************************************************************}
  372. constructor tvmtclass.constructor_params_mixed(u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  373. begin
  374. inherited create;
  375. object_u8bit := u8;
  376. object_u16bit := u16;
  377. object_bigstring := bigstring;
  378. object_s32bit := s32;
  379. object_s64bit := s64;
  380. end;
  381. constructor tvmtclass.constructor_init;
  382. begin
  383. inherited create;
  384. object_u8bit := 0;
  385. object_u16bit := 0;
  386. object_bigstring := '';
  387. object_s32bit := 0;
  388. object_s64bit := 0;
  389. end;
  390. destructor tvmtclass.destructor_params_done;
  391. begin
  392. { this is used to call the destructor inside the class }
  393. global_u8bit := object_u8bit;
  394. global_u16bit := object_u16bit;
  395. global_bigstring := object_bigstring;
  396. global_s32bit := object_s32bit;
  397. global_s64bit := object_s64bit;
  398. object_u8bit := 0;
  399. object_u16bit := 0;
  400. object_bigstring := '';
  401. object_s32bit := 0;
  402. object_s64bit := 0;
  403. inherited destroy;
  404. end;
  405. procedure tvmtclass.method_normal_params_mixed(
  406. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  407. begin
  408. object_u8bit := u8;
  409. object_u16bit := u16;
  410. object_bigstring := bigstring;
  411. object_s32bit := s32;
  412. object_s64bit := s64;
  413. end;
  414. procedure tvmtclass.method_virtual_params_mixed(
  415. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  416. begin
  417. object_u8bit := u8;
  418. object_u16bit := u16;
  419. object_bigstring := bigstring;
  420. object_s32bit := s32;
  421. object_s64bit := s64;
  422. end;
  423. procedure tvmtclass.method_dynamic_params_mixed(u8 :byte; u16: word;
  424. bigstring: shortstring; s32: longint; s64: int64);
  425. begin
  426. object_u8bit := u8;
  427. object_u16bit := u16;
  428. object_bigstring := bigstring;
  429. object_s32bit := s32;
  430. object_s64bit := s64;
  431. end;
  432. { can't access field of instances in static methods }
  433. class procedure tvmtclass.method_static_params_mixed(
  434. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  435. begin
  436. global_u8bit := u8;
  437. global_u16bit := u16;
  438. global_bigstring := bigstring;
  439. global_s32bit := s32;
  440. global_s64bit := s64;
  441. end;
  442. procedure tvmtclass.method_normal_call_inherited_params_mixed(
  443. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  444. begin
  445. object_u8bit := u8;
  446. object_u16bit := u16;
  447. object_bigstring := bigstring;
  448. object_s32bit := s32;
  449. object_s64bit := s64;
  450. end;
  451. procedure tvmtclass.method_virtual_call_static_params_mixed(
  452. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  453. begin
  454. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  455. end;
  456. procedure tvmtclass.method_virtual_call_virtual_params_mixed(
  457. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  458. begin
  459. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  460. end;
  461. procedure tvmtclass.method_virtual_call_overriden_params_mixed(
  462. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  463. begin
  464. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  465. end;
  466. procedure tvmtclass.method_virtual_call_normal_params_mixed(
  467. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  468. begin
  469. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  470. end;
  471. procedure tvmtclass.method_virtual_call_constructor_params_mixed(
  472. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  473. begin
  474. constructor_params_mixed(u8, u16, bigstring, s32, s64);
  475. end;
  476. procedure tvmtclass.method_virtual_call_destructor;
  477. begin
  478. destructor_params_done;
  479. end;
  480. procedure tvmtclass.method_virtual_call_inherited_params_mixed(
  481. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  482. begin
  483. object_u8bit := u8;
  484. object_u16bit := u16;
  485. object_bigstring := bigstring;
  486. object_s32bit := s32;
  487. object_s64bit := s64;
  488. end;
  489. { dynamic methods }
  490. procedure tvmtclass.method_dynamic_call_static_params_mixed(
  491. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  492. begin
  493. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  494. end;
  495. procedure tvmtclass.method_dynamic_call_virtual_params_mixed(
  496. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  497. begin
  498. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  499. end;
  500. procedure tvmtclass.method_dynamic_call_overriden_params_mixed(
  501. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  502. begin
  503. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  504. end;
  505. procedure tvmtclass.method_dynamic_call_normal_params_mixed(
  506. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  507. begin
  508. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  509. end;
  510. procedure tvmtclass.method_dynamic_call_constructor_params_mixed(
  511. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  512. begin
  513. constructor_params_mixed(u8, u16, bigstring, s32, s64);
  514. end;
  515. procedure tvmtclass.method_dynamic_call_destructor;
  516. begin
  517. destructor_params_done;
  518. end;
  519. procedure tvmtclass.method_dynamic_call_inherited_params_mixed(
  520. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  521. begin
  522. object_u8bit := u8;
  523. object_u16bit := u16;
  524. object_bigstring := bigstring;
  525. object_s32bit := s32;
  526. object_s64bit := s64;
  527. end;
  528. {**************************************************************************}
  529. { INHERITED VMT OBJECT }
  530. {**************************************************************************}
  531. constructor theritedvmtclass.constructor_params_mixed_call_virtual(
  532. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  533. begin
  534. inherited create;
  535. object_u8bit := 0;
  536. object_u16bit := 0;
  537. object_bigstring := '';
  538. object_s32bit := 0;
  539. object_s64bit := 0;
  540. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  541. end;
  542. constructor theritedvmtclass.constructor_params_mixed_call_overriden(
  543. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  544. begin
  545. inherited create;
  546. object_u8bit := 0;
  547. object_u16bit := 0;
  548. object_bigstring := '';
  549. object_s32bit := 0;
  550. object_s64bit := 0;
  551. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  552. end;
  553. constructor theritedvmtclass.constructor_params_mixed_call_static(
  554. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  555. begin
  556. inherited create;
  557. object_u8bit := 0;
  558. object_u16bit := 0;
  559. object_bigstring := '';
  560. object_s32bit := 0;
  561. object_s64bit := 0;
  562. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  563. end;
  564. constructor theritedvmtclass.constructor_params_mixed_call_normal(
  565. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  566. begin
  567. inherited create;
  568. object_u8bit := 0;
  569. object_u16bit := 0;
  570. object_bigstring := '';
  571. object_s32bit := 0;
  572. object_s64bit := 0;
  573. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  574. end;
  575. constructor theritedvmtclass.constructor_params_mixed_call_inherited
  576. (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  577. begin
  578. inherited create;
  579. object_u8bit := 0;
  580. object_u16bit := 0;
  581. object_bigstring := '';
  582. object_s32bit := 0;
  583. object_s64bit := 0;
  584. inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
  585. end;
  586. procedure theritedvmtclass.method_virtual_overriden_params_mixed(
  587. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  588. begin
  589. object_u8bit := u8;
  590. object_u16bit := u16;
  591. object_bigstring := bigstring;
  592. object_s32bit := s32;
  593. object_s64bit := s64;
  594. end;
  595. procedure theritedvmtclass.method_dynamic_overriden_params_mixed(
  596. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  597. begin
  598. object_u8bit := u8;
  599. object_u16bit := u16;
  600. object_bigstring := bigstring;
  601. object_s32bit := s32;
  602. object_s64bit := s64;
  603. end;
  604. procedure theritedvmtclass.method_normal_call_static_params_mixed(
  605. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  606. begin
  607. method_static_params_mixed(u8, u16, bigstring, s32, s64);
  608. end;
  609. procedure theritedvmtclass.method_normal_call_virtual_params_mixed(
  610. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  611. begin
  612. method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
  613. end;
  614. procedure theritedvmtclass.method_normal_call_overriden_params_mixed(
  615. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  616. begin
  617. method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
  618. end;
  619. procedure theritedvmtclass.method_normal_call_normal_params_mixed(
  620. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  621. begin
  622. method_normal_params_mixed(u8, u16, bigstring, s32, s64);
  623. end;
  624. procedure theritedvmtclass.method_normal_call_constructor_params_mixed(
  625. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  626. begin
  627. constructor_params_mixed(u8, u16, bigstring, s32, s64);
  628. end;
  629. procedure theritedvmtclass.method_normal_call_inherited_params_mixed(
  630. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  631. begin
  632. Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
  633. s32, s64);
  634. end;
  635. procedure theritedvmtclass.method_virtual_call_inherited_params_mixed(
  636. u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
  637. begin
  638. Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
  639. s32, s64);
  640. end;
  641. procedure testnovmtclass;
  642. var
  643. novmtclass : tnovmtclass;
  644. failed : boolean;
  645. begin
  646. {******************** STATIC / METHOD SIMPLE CALL **********************}
  647. Write('No parameter / method call testing...');
  648. failed := false;
  649. novmtclass := tnovmtclass.create;
  650. clear_globals;
  651. clear_values;
  652. tnovmtclass.method_public_static_none;
  653. if global_u8bit <> RESULT_U8BIT then
  654. failed := true;
  655. clear_globals;
  656. clear_values;
  657. novmtclass.method_public_static_none;
  658. if global_u8bit <> RESULT_U8BIT then
  659. failed := true;
  660. clear_globals;
  661. clear_values;
  662. tnovmtclass.method_call_private_static_none;
  663. if global_u16bit <> RESULT_U8BIT then
  664. failed := true;
  665. clear_globals;
  666. clear_values;
  667. novmtclass.method_call_private_static_none;
  668. if global_u16bit <> RESULT_U8BIT then
  669. failed := true;
  670. clear_globals;
  671. clear_values;
  672. novmtclass.method_public_none;
  673. if global_u8bit <> RESULT_U8BIT then
  674. failed := true;
  675. clear_globals;
  676. clear_values;
  677. novmtclass.method_call_private_none;
  678. if global_u16bit <> (RESULT_U16BIT) then
  679. failed := true;
  680. if failed then
  681. fail
  682. else
  683. WriteLn('Passed!');
  684. Write('Simple parameter (LOC_CONSTANT) / method call testing...');
  685. failed := false;
  686. clear_globals;
  687. clear_values;
  688. { parameter is LOC_CONSTANT }
  689. novmtclass.method_public_u8(RESULT_U8BIT);
  690. if global_u8bit <> RESULT_U8BIT then
  691. failed := true;
  692. clear_globals;
  693. clear_values;
  694. tnovmtclass.method_public_static_u8(RESULT_U8BIT);
  695. if global_u8bit <> RESULT_U8BIT then
  696. failed := true;
  697. clear_globals;
  698. clear_values;
  699. novmtclass.method_public_static_u8(RESULT_U8BIT);
  700. if global_u8bit <> RESULT_U8BIT then
  701. failed := true;
  702. clear_globals;
  703. clear_values;
  704. novmtclass.method_call_private_u8(RESULT_U8BIT);
  705. if global_u16bit <> (RESULT_U16BIT) then
  706. failed := true;
  707. clear_globals;
  708. clear_values;
  709. novmtclass.method_call_private_static_u8(RESULT_U8BIT);
  710. if global_u16bit <> (RESULT_U8BIT) then
  711. failed := true;
  712. if failed then
  713. fail
  714. else
  715. WriteLn('Passed!');
  716. Write('Simple parameter (LOC_REFERENCE) / method call testing...');
  717. failed := false;
  718. clear_globals;
  719. clear_values;
  720. value_u8bit := RESULT_U8BIT;
  721. novmtclass.method_public_u8(value_u8bit);
  722. if global_u8bit <> RESULT_U8BIT then
  723. failed := true;
  724. clear_globals;
  725. clear_values;
  726. value_u8bit := RESULT_U8BIT;
  727. tnovmtclass.method_public_static_u8(value_u8bit);
  728. if global_u8bit <> RESULT_U8BIT then
  729. failed := true;
  730. clear_globals;
  731. clear_values;
  732. value_u8bit := RESULT_U8BIT;
  733. novmtclass.method_public_static_u8(value_u8bit);
  734. if global_u8bit <> RESULT_U8BIT then
  735. failed := true;
  736. clear_globals;
  737. clear_values;
  738. value_u8bit := RESULT_U8BIT;
  739. novmtclass.method_call_private_u8(value_u8bit);
  740. if global_u16bit <> (RESULT_U16BIT) then
  741. failed := true;
  742. clear_globals;
  743. clear_values;
  744. value_u8bit := RESULT_U8BIT;
  745. novmtclass.method_call_private_static_u8(value_u8bit);
  746. if global_u16bit <> (RESULT_U8BIT) then
  747. failed := true;
  748. if failed then
  749. fail
  750. else
  751. WriteLn('Passed!');
  752. Write('Simple parameter (LOC_REGISTER) / method call testing...');
  753. failed := false;
  754. clear_globals;
  755. clear_values;
  756. novmtclass.method_public_u8(getu8);
  757. if global_u8bit <> RESULT_U8BIT then
  758. failed := true;
  759. clear_globals;
  760. clear_values;
  761. tnovmtclass.method_public_static_u8(getu8);
  762. if global_u8bit <> RESULT_U8BIT then
  763. failed := true;
  764. clear_globals;
  765. clear_values;
  766. novmtclass.method_public_static_u8(getu8);
  767. if global_u8bit <> RESULT_U8BIT then
  768. failed := true;
  769. clear_globals;
  770. clear_values;
  771. novmtclass.method_call_private_u8(getu8);
  772. if global_u16bit <> (RESULT_U16BIT) then
  773. failed := true;
  774. clear_globals;
  775. clear_values;
  776. novmtclass.method_call_private_static_u8(getu8);
  777. if global_u16bit <> (RESULT_U8BIT) then
  778. failed := true;
  779. if failed then
  780. fail
  781. else
  782. WriteLn('Passed!');
  783. Write('Simple parameter / complex return / nested method access testing...');
  784. clear_globals;
  785. clear_values;
  786. failed := false;
  787. novmtclass.object_bigstring := RESULT_BIGSTRING;
  788. novmtclass.object_u16bit := RESULT_U16BIT;
  789. value_smallarray := novmtclass.func_array_mixed_nested(RESULT_U8BIT);
  790. if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
  791. failed := true;
  792. if global_u8bit <> RESULT_U8BIT then
  793. failed := true;
  794. if global_bigstring <> RESULT_BIGSTRING then
  795. failed := true;
  796. if global_u16bit <> RESULT_U16BIT then
  797. failed := true;
  798. if global_s32bit <> RESULT_S32BIT then
  799. failed := true;
  800. if global_s64bit <> RESULT_U8BIT then
  801. failed := true;
  802. if failed then
  803. fail
  804. else
  805. WriteLn('Passed!');
  806. novmtclass.destroy;
  807. end;
  808. procedure testfailedclass;
  809. var
  810. failedobject : tfailvmtclass;
  811. begin
  812. Write('Testing constructor return value...');
  813. { if failedobject.constructor_public_none then
  814. fail
  815. else
  816. Writeln('Passed!');}
  817. end;
  818. procedure testvmtclass;
  819. var
  820. vmtclass : tvmtclass;
  821. failed : boolean;
  822. begin
  823. clear_globals;
  824. clear_values;
  825. failed := false;
  826. Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
  827. vmtclass:=tvmtclass.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  828. if vmtclass.object_u8bit <> RESULT_U8BIT then
  829. failed := true;
  830. if vmtclass.object_u16bit <> RESULT_U16BIT then
  831. failed := true;
  832. if vmtclass.object_s32bit <> RESULT_S32BIT then
  833. failed := true;
  834. if vmtclass.object_s64bit <> RESULT_S64BIT then
  835. failed := true;
  836. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  837. failed := true;
  838. vmtclass.destructor_params_done;
  839. if failed then
  840. fail
  841. else
  842. Writeln('Passed!');
  843. clear_globals;
  844. clear_values;
  845. failed := false;
  846. Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
  847. value_u8bit := RESULT_U8BIT;
  848. value_u16bit := RESULT_U16BIT;
  849. value_bigstring := RESULT_BIGSTRING;
  850. value_s32bit := RESULT_S32BIT;
  851. value_s64bit := RESULT_S64BIT;
  852. vmtclass := tvmtclass.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring,
  853. value_s32bit, value_s64bit);
  854. if vmtclass.object_u8bit <> RESULT_U8BIT then
  855. failed := true;
  856. if vmtclass.object_u16bit <> RESULT_U16BIT then
  857. failed := true;
  858. if vmtclass.object_s32bit <> RESULT_S32BIT then
  859. failed := true;
  860. if vmtclass.object_s64bit <> RESULT_S64BIT then
  861. failed := true;
  862. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  863. failed := true;
  864. vmtclass.destructor_params_done;
  865. if failed then
  866. fail
  867. else
  868. Writeln('Passed!');
  869. end;
  870. procedure testheritedvmtclass;
  871. var
  872. vmtclass : theritedvmtclass;
  873. failed : boolean;
  874. begin
  875. {********************** CONSTRUCTOR TESTING ************************}
  876. {********************** DESTRUCTOR TESTING ************************}
  877. clear_globals;
  878. clear_values;
  879. failed := false;
  880. Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
  881. vmtclass := theritedvmtclass.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING,
  882. RESULT_S32BIT, RESULT_S64BIT);
  883. if vmtclass.object_u8bit <> RESULT_U8BIT then
  884. failed := true;
  885. if vmtclass.object_u16bit <> RESULT_U16BIT then
  886. failed := true;
  887. if vmtclass.object_s32bit <> RESULT_S32BIT then
  888. failed := true;
  889. if vmtclass.object_s64bit <> RESULT_S64BIT then
  890. failed := true;
  891. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  892. failed := true;
  893. vmtclass.destructor_params_done;
  894. if failed then
  895. fail
  896. else
  897. Writeln('Passed!');
  898. clear_globals;
  899. clear_values;
  900. failed := false;
  901. Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
  902. value_u8bit := RESULT_U8BIT;
  903. value_u16bit := RESULT_U16BIT;
  904. value_bigstring := RESULT_BIGSTRING;
  905. value_s32bit := RESULT_S32BIT;
  906. value_s64bit := RESULT_S64BIT;
  907. vmtclass := theritedvmtclass.constructor_params_mixed_call_inherited(value_u8bit,
  908. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  909. if vmtclass.object_u8bit <> RESULT_U8BIT then
  910. failed := true;
  911. if vmtclass.object_u16bit <> RESULT_U16BIT then
  912. failed := true;
  913. if vmtclass.object_s32bit <> RESULT_S32BIT then
  914. failed := true;
  915. if vmtclass.object_s64bit <> RESULT_S64BIT then
  916. failed := true;
  917. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  918. failed := true;
  919. vmtclass.destructor_params_done;
  920. if failed then
  921. fail
  922. else
  923. Writeln('Passed!');
  924. clear_globals;
  925. clear_values;
  926. failed := false;
  927. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  928. vmtclass := theritedvmtclass.constructor_params_mixed_call_virtual(RESULT_U8BIT,
  929. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  930. if vmtclass.object_u8bit <> RESULT_U8BIT then
  931. failed := true;
  932. if vmtclass.object_u16bit <> RESULT_U16BIT then
  933. failed := true;
  934. if vmtclass.object_s32bit <> RESULT_S32BIT then
  935. failed := true;
  936. if vmtclass.object_s64bit <> RESULT_S64BIT then
  937. failed := true;
  938. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  939. failed := true;
  940. vmtclass.destructor_params_done;
  941. if failed then
  942. fail
  943. else
  944. Writeln('Passed!');
  945. clear_globals;
  946. clear_values;
  947. failed := false;
  948. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  949. value_u8bit := RESULT_U8BIT;
  950. value_u16bit := RESULT_U16BIT;
  951. value_bigstring := RESULT_BIGSTRING;
  952. value_s32bit := RESULT_S32BIT;
  953. value_s64bit := RESULT_S64BIT;
  954. vmtclass:=theritedvmtclass.constructor_params_mixed_call_virtual(value_u8bit,
  955. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  956. if vmtclass.object_u8bit <> RESULT_U8BIT then
  957. failed := true;
  958. if vmtclass.object_u16bit <> RESULT_U16BIT then
  959. failed := true;
  960. if vmtclass.object_s32bit <> RESULT_S32BIT then
  961. failed := true;
  962. if vmtclass.object_s64bit <> RESULT_S64BIT then
  963. failed := true;
  964. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  965. failed := true;
  966. vmtclass.destructor_params_done;
  967. if failed then
  968. fail
  969. else
  970. Writeln('Passed!');
  971. clear_globals;
  972. clear_values;
  973. failed := false;
  974. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  975. vmtclass:=theritedvmtclass.constructor_params_mixed_call_overriden(RESULT_U8BIT,
  976. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  977. if vmtclass.object_u8bit <> RESULT_U8BIT then
  978. failed := true;
  979. if vmtclass.object_u16bit <> RESULT_U16BIT then
  980. failed := true;
  981. if vmtclass.object_s32bit <> RESULT_S32BIT then
  982. failed := true;
  983. if vmtclass.object_s64bit <> RESULT_S64BIT then
  984. failed := true;
  985. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  986. failed := true;
  987. vmtclass.destructor_params_done;
  988. if failed then
  989. fail
  990. else
  991. Writeln('Passed!');
  992. clear_globals;
  993. clear_values;
  994. failed := false;
  995. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  996. value_u8bit := RESULT_U8BIT;
  997. value_u16bit := RESULT_U16BIT;
  998. value_bigstring := RESULT_BIGSTRING;
  999. value_s32bit := RESULT_S32BIT;
  1000. value_s64bit := RESULT_S64BIT;
  1001. vmtclass:=theritedvmtclass.constructor_params_mixed_call_overriden(value_u8bit,
  1002. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1003. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1004. failed := true;
  1005. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1006. failed := true;
  1007. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1008. failed := true;
  1009. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1010. failed := true;
  1011. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1012. failed := true;
  1013. vmtclass.destructor_params_done;
  1014. if failed then
  1015. fail
  1016. else
  1017. Writeln('Passed!');
  1018. clear_globals;
  1019. clear_values;
  1020. failed := false;
  1021. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
  1022. vmtclass:=theritedvmtclass.constructor_params_mixed_call_normal(RESULT_U8BIT,
  1023. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1024. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1025. failed := true;
  1026. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1027. failed := true;
  1028. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1029. failed := true;
  1030. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1031. failed := true;
  1032. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1033. failed := true;
  1034. vmtclass.destructor_params_done;
  1035. if failed then
  1036. fail
  1037. else
  1038. Writeln('Passed!');
  1039. clear_globals;
  1040. clear_values;
  1041. failed := false;
  1042. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
  1043. value_u8bit := RESULT_U8BIT;
  1044. value_u16bit := RESULT_U16BIT;
  1045. value_bigstring := RESULT_BIGSTRING;
  1046. value_s32bit := RESULT_S32BIT;
  1047. value_s64bit := RESULT_S64BIT;
  1048. vmtclass:=theritedvmtclass.constructor_params_mixed_call_normal(value_u8bit,
  1049. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1050. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1051. failed := true;
  1052. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1053. failed := true;
  1054. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1055. failed := true;
  1056. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1057. failed := true;
  1058. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1059. failed := true;
  1060. vmtclass.destructor_params_done;
  1061. if failed then
  1062. fail
  1063. else
  1064. Writeln('Passed!');
  1065. clear_globals;
  1066. clear_values;
  1067. failed := false;
  1068. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
  1069. vmtclass:=theritedvmtclass.constructor_params_mixed_call_static(RESULT_U8BIT,
  1070. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1071. if global_u8bit <> RESULT_U8BIT then
  1072. failed := true;
  1073. if global_u16bit <> RESULT_U16BIT then
  1074. failed := true;
  1075. if global_s32bit <> RESULT_S32BIT then
  1076. failed := true;
  1077. if global_s64bit <> RESULT_S64BIT then
  1078. failed := true;
  1079. if global_bigstring <> RESULT_BIGSTRING then
  1080. failed := true;
  1081. vmtclass.destructor_params_done;
  1082. if failed then
  1083. fail
  1084. else
  1085. Writeln('Passed!');
  1086. clear_globals;
  1087. clear_values;
  1088. failed := false;
  1089. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
  1090. value_u8bit := RESULT_U8BIT;
  1091. value_u16bit := RESULT_U16BIT;
  1092. value_bigstring := RESULT_BIGSTRING;
  1093. value_s32bit := RESULT_S32BIT;
  1094. value_s64bit := RESULT_S64BIT;
  1095. vmtclass:=theritedvmtclass.constructor_params_mixed_call_static(value_u8bit,
  1096. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1097. if global_u8bit <> RESULT_U8BIT then
  1098. failed := true;
  1099. if global_u16bit <> RESULT_U16BIT then
  1100. failed := true;
  1101. if global_s32bit <> RESULT_S32BIT then
  1102. failed := true;
  1103. if global_s64bit <> RESULT_S64BIT then
  1104. failed := true;
  1105. if global_bigstring <> RESULT_BIGSTRING then
  1106. failed := true;
  1107. vmtclass.destructor_params_done;
  1108. if failed then
  1109. fail
  1110. else
  1111. Writeln('Passed!');
  1112. {************************* METHOD TESTING **************************}
  1113. clear_globals;
  1114. clear_values;
  1115. failed := false;
  1116. vmtclass:=theritedvmtclass.constructor_init;
  1117. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  1118. vmtclass.method_virtual_params_mixed(RESULT_U8BIT,
  1119. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1120. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1121. failed := true;
  1122. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1123. failed := true;
  1124. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1125. failed := true;
  1126. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1127. failed := true;
  1128. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1129. failed := true;
  1130. vmtclass.destructor_params_done;
  1131. if failed then
  1132. fail
  1133. else
  1134. Writeln('Passed!');
  1135. clear_globals;
  1136. clear_values;
  1137. failed := false;
  1138. vmtclass:=theritedvmtclass.constructor_init;
  1139. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  1140. value_u8bit := RESULT_U8BIT;
  1141. value_u16bit := RESULT_U16BIT;
  1142. value_bigstring := RESULT_BIGSTRING;
  1143. value_s32bit := RESULT_S32BIT;
  1144. value_s64bit := RESULT_S64BIT;
  1145. vmtclass.method_virtual_params_mixed(value_u8bit,
  1146. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1147. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1148. failed := true;
  1149. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1150. failed := true;
  1151. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1152. failed := true;
  1153. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1154. failed := true;
  1155. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1156. failed := true;
  1157. vmtclass.destructor_params_done;
  1158. if failed then
  1159. fail
  1160. else
  1161. Writeln('Passed!');
  1162. clear_globals;
  1163. clear_values;
  1164. failed := false;
  1165. vmtclass:=theritedvmtclass.constructor_init;
  1166. Write('Testing mixed parameter (LOC_CONSTANT) dynamic method call...');
  1167. vmtclass.method_dynamic_params_mixed(RESULT_U8BIT,
  1168. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1169. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1170. failed := true;
  1171. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1172. failed := true;
  1173. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1174. failed := true;
  1175. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1176. failed := true;
  1177. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1178. failed := true;
  1179. vmtclass.destructor_params_done;
  1180. if failed then
  1181. fail
  1182. else
  1183. Writeln('Passed!');
  1184. clear_globals;
  1185. clear_values;
  1186. failed := false;
  1187. vmtclass:=theritedvmtclass.constructor_init;
  1188. Write('Testing mixed parameter (LOC_CONSTANT) dynamic method call...');
  1189. vmtclass.method_dynamic_overriden_params_mixed(RESULT_U8BIT,
  1190. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1191. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1192. failed := true;
  1193. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1194. failed := true;
  1195. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1196. failed := true;
  1197. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1198. failed := true;
  1199. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1200. failed := true;
  1201. vmtclass.destructor_params_done;
  1202. if failed then
  1203. fail
  1204. else
  1205. Writeln('Passed!');
  1206. clear_globals;
  1207. clear_values;
  1208. failed := false;
  1209. vmtclass:=theritedvmtclass.constructor_init;
  1210. Write('Testing mixed parameter (LOC_REFERENCE) dynamic method call...');
  1211. value_u8bit := RESULT_U8BIT;
  1212. value_u16bit := RESULT_U16BIT;
  1213. value_bigstring := RESULT_BIGSTRING;
  1214. value_s32bit := RESULT_S32BIT;
  1215. value_s64bit := RESULT_S64BIT;
  1216. vmtclass.method_dynamic_overriden_params_mixed(value_u8bit,
  1217. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1218. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1219. failed := true;
  1220. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1221. failed := true;
  1222. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1223. failed := true;
  1224. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1225. failed := true;
  1226. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1227. failed := true;
  1228. vmtclass.destructor_params_done;
  1229. if failed then
  1230. fail
  1231. else
  1232. Writeln('Passed!');
  1233. clear_globals;
  1234. clear_values;
  1235. failed := false;
  1236. vmtclass:=theritedvmtclass.constructor_init;
  1237. Write('Testing mixed parameter (LOC_REFERENCE) dynamic method call...');
  1238. value_u8bit := RESULT_U8BIT;
  1239. value_u16bit := RESULT_U16BIT;
  1240. value_bigstring := RESULT_BIGSTRING;
  1241. value_s32bit := RESULT_S32BIT;
  1242. value_s64bit := RESULT_S64BIT;
  1243. vmtclass.method_dynamic_params_mixed(value_u8bit,
  1244. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1245. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1246. failed := true;
  1247. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1248. failed := true;
  1249. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1250. failed := true;
  1251. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1252. failed := true;
  1253. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1254. failed := true;
  1255. vmtclass.destructor_params_done;
  1256. if failed then
  1257. fail
  1258. else
  1259. Writeln('Passed!');
  1260. clear_globals;
  1261. clear_values;
  1262. failed := false;
  1263. vmtclass:=theritedvmtclass.constructor_init;
  1264. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  1265. vmtclass.method_virtual_overriden_params_mixed(RESULT_U8BIT,
  1266. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1267. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1268. failed := true;
  1269. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1270. failed := true;
  1271. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1272. failed := true;
  1273. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1274. failed := true;
  1275. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1276. failed := true;
  1277. vmtclass.destructor_params_done;
  1278. if failed then
  1279. fail
  1280. else
  1281. Writeln('Passed!');
  1282. clear_globals;
  1283. clear_values;
  1284. failed := false;
  1285. vmtclass:=theritedvmtclass.constructor_init;
  1286. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  1287. value_u8bit := RESULT_U8BIT;
  1288. value_u16bit := RESULT_U16BIT;
  1289. value_bigstring := RESULT_BIGSTRING;
  1290. value_s32bit := RESULT_S32BIT;
  1291. value_s64bit := RESULT_S64BIT;
  1292. vmtclass.method_virtual_overriden_params_mixed(value_u8bit,
  1293. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1294. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1295. failed := true;
  1296. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1297. failed := true;
  1298. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1299. failed := true;
  1300. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1301. failed := true;
  1302. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1303. failed := true;
  1304. vmtclass.destructor_params_done;
  1305. if failed then
  1306. fail
  1307. else
  1308. Writeln('Passed!');
  1309. clear_globals;
  1310. clear_values;
  1311. failed := false;
  1312. vmtclass:=theritedvmtclass.constructor_init;
  1313. Write('Testing mixed parameter (LOC_CONSTANT) method call...');
  1314. vmtclass.method_normal_params_mixed(RESULT_U8BIT,
  1315. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1316. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1317. failed := true;
  1318. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1319. failed := true;
  1320. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1321. failed := true;
  1322. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1323. failed := true;
  1324. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1325. failed := true;
  1326. vmtclass.destructor_params_done;
  1327. if failed then
  1328. fail
  1329. else
  1330. Writeln('Passed!');
  1331. clear_globals;
  1332. clear_values;
  1333. failed := false;
  1334. vmtclass:=theritedvmtclass.constructor_init;
  1335. Write('Testing mixed parameter (LOC_REFERENCE) method call...');
  1336. value_u8bit := RESULT_U8BIT;
  1337. value_u16bit := RESULT_U16BIT;
  1338. value_bigstring := RESULT_BIGSTRING;
  1339. value_s32bit := RESULT_S32BIT;
  1340. value_s64bit := RESULT_S64BIT;
  1341. vmtclass.method_normal_params_mixed(value_u8bit,
  1342. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1343. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1344. failed := true;
  1345. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1346. failed := true;
  1347. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1348. failed := true;
  1349. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1350. failed := true;
  1351. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1352. failed := true;
  1353. vmtclass.destructor_params_done;
  1354. if failed then
  1355. fail
  1356. else
  1357. Writeln('Passed!');
  1358. clear_globals;
  1359. clear_values;
  1360. failed := false;
  1361. vmtclass:=theritedvmtclass.constructor_init;
  1362. Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
  1363. vmtclass.method_static_params_mixed(RESULT_U8BIT,
  1364. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1365. if global_u8bit <> RESULT_U8BIT then
  1366. failed := true;
  1367. if global_u16bit <> RESULT_U16BIT then
  1368. failed := true;
  1369. if global_s32bit <> RESULT_S32BIT then
  1370. failed := true;
  1371. if global_s64bit <> RESULT_S64BIT then
  1372. failed := true;
  1373. if global_bigstring <> RESULT_BIGSTRING then
  1374. failed := true;
  1375. vmtclass.destructor_params_done;
  1376. if failed then
  1377. fail
  1378. else
  1379. Writeln('Passed!');
  1380. clear_globals;
  1381. clear_values;
  1382. failed := false;
  1383. vmtclass:=theritedvmtclass.constructor_init;
  1384. Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
  1385. value_u8bit := RESULT_U8BIT;
  1386. value_u16bit := RESULT_U16BIT;
  1387. value_bigstring := RESULT_BIGSTRING;
  1388. value_s32bit := RESULT_S32BIT;
  1389. value_s64bit := RESULT_S64BIT;
  1390. vmtclass.method_static_params_mixed(value_u8bit,
  1391. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1392. if global_u8bit <> RESULT_U8BIT then
  1393. failed := true;
  1394. if global_u16bit <> RESULT_U16BIT then
  1395. failed := true;
  1396. if global_s32bit <> RESULT_S32BIT then
  1397. failed := true;
  1398. if global_s64bit <> RESULT_S64BIT then
  1399. failed := true;
  1400. if global_bigstring <> RESULT_BIGSTRING then
  1401. failed := true;
  1402. vmtclass.destructor_params_done;
  1403. if failed then
  1404. fail
  1405. else
  1406. Writeln('Passed!');
  1407. { ********************************************************************
  1408. This calls methods which in turn call other methods, or a constructor
  1409. or a destructor.
  1410. *********************************************************************
  1411. }
  1412. clear_globals;
  1413. clear_values;
  1414. failed := false;
  1415. { Calls the ancestor virtual method }
  1416. vmtclass:=theritedvmtclass.constructor_init;
  1417. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  1418. vmtclass.method_normal_call_virtual_params_mixed(RESULT_U8BIT,
  1419. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1420. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1421. failed := true;
  1422. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1423. failed := true;
  1424. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1425. failed := true;
  1426. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1427. failed := true;
  1428. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1429. failed := true;
  1430. vmtclass.destructor_params_done;
  1431. if failed then
  1432. fail
  1433. else
  1434. Writeln('Passed!');
  1435. clear_globals;
  1436. clear_values;
  1437. failed := false;
  1438. vmtclass:=theritedvmtclass.constructor_init;
  1439. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  1440. value_u8bit := RESULT_U8BIT;
  1441. value_u16bit := RESULT_U16BIT;
  1442. value_bigstring := RESULT_BIGSTRING;
  1443. value_s32bit := RESULT_S32BIT;
  1444. value_s64bit := RESULT_S64BIT;
  1445. vmtclass.method_normal_call_virtual_params_mixed(value_u8bit,
  1446. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1447. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1448. failed := true;
  1449. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1450. failed := true;
  1451. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1452. failed := true;
  1453. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1454. failed := true;
  1455. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1456. failed := true;
  1457. vmtclass.destructor_params_done;
  1458. if failed then
  1459. fail
  1460. else
  1461. Writeln('Passed!');
  1462. { The virtual method has been overriden by the object in this case }
  1463. vmtclass:=theritedvmtclass.constructor_init;
  1464. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  1465. vmtclass.method_normal_call_overriden_params_mixed(RESULT_U8BIT,
  1466. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1467. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1468. failed := true;
  1469. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1470. failed := true;
  1471. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1472. failed := true;
  1473. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1474. failed := true;
  1475. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1476. failed := true;
  1477. vmtclass.destructor_params_done;
  1478. if failed then
  1479. fail
  1480. else
  1481. Writeln('Passed!');
  1482. clear_globals;
  1483. clear_values;
  1484. failed := false;
  1485. vmtclass:=theritedvmtclass.constructor_init;
  1486. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  1487. value_u8bit := RESULT_U8BIT;
  1488. value_u16bit := RESULT_U16BIT;
  1489. value_bigstring := RESULT_BIGSTRING;
  1490. value_s32bit := RESULT_S32BIT;
  1491. value_s64bit := RESULT_S64BIT;
  1492. vmtclass.method_normal_call_overriden_params_mixed(value_u8bit,
  1493. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1494. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1495. failed := true;
  1496. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1497. failed := true;
  1498. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1499. failed := true;
  1500. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1501. failed := true;
  1502. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1503. failed := true;
  1504. vmtclass.destructor_params_done;
  1505. if failed then
  1506. fail
  1507. else
  1508. Writeln('Passed!');
  1509. clear_globals;
  1510. clear_values;
  1511. failed := false;
  1512. vmtclass:=theritedvmtclass.constructor_init;
  1513. Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
  1514. vmtclass.method_normal_call_normal_params_mixed(RESULT_U8BIT,
  1515. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1516. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1517. failed := true;
  1518. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1519. failed := true;
  1520. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1521. failed := true;
  1522. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1523. failed := true;
  1524. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1525. failed := true;
  1526. vmtclass.destructor_params_done;
  1527. if failed then
  1528. fail
  1529. else
  1530. Writeln('Passed!');
  1531. clear_globals;
  1532. clear_values;
  1533. failed := false;
  1534. vmtclass:=theritedvmtclass.constructor_init;
  1535. Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
  1536. value_u8bit := RESULT_U8BIT;
  1537. value_u16bit := RESULT_U16BIT;
  1538. value_bigstring := RESULT_BIGSTRING;
  1539. value_s32bit := RESULT_S32BIT;
  1540. value_s64bit := RESULT_S64BIT;
  1541. vmtclass.method_normal_call_normal_params_mixed(value_u8bit,
  1542. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1543. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1544. failed := true;
  1545. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1546. failed := true;
  1547. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1548. failed := true;
  1549. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1550. failed := true;
  1551. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1552. failed := true;
  1553. vmtclass.destructor_params_done;
  1554. if failed then
  1555. fail
  1556. else
  1557. Writeln('Passed!');
  1558. (* constructor call inside a normal method *)
  1559. clear_globals;
  1560. clear_values;
  1561. failed := false;
  1562. vmtclass:=theritedvmtclass.constructor_init;
  1563. Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
  1564. vmtclass.method_normal_call_constructor_params_mixed(RESULT_U8BIT,
  1565. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1566. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1567. failed := true;
  1568. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1569. failed := true;
  1570. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1571. failed := true;
  1572. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1573. failed := true;
  1574. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1575. failed := true;
  1576. vmtclass.destructor_params_done;
  1577. if failed then
  1578. fail
  1579. else
  1580. Writeln('Passed!');
  1581. clear_globals;
  1582. clear_values;
  1583. failed := false;
  1584. vmtclass:=theritedvmtclass.constructor_init;
  1585. Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
  1586. value_u8bit := RESULT_U8BIT;
  1587. value_u16bit := RESULT_U16BIT;
  1588. value_bigstring := RESULT_BIGSTRING;
  1589. value_s32bit := RESULT_S32BIT;
  1590. value_s64bit := RESULT_S64BIT;
  1591. vmtclass.method_normal_call_constructor_params_mixed(value_u8bit,
  1592. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1593. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1594. failed := true;
  1595. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1596. failed := true;
  1597. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1598. failed := true;
  1599. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1600. failed := true;
  1601. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1602. failed := true;
  1603. vmtclass.destructor_params_done;
  1604. if failed then
  1605. fail
  1606. else
  1607. Writeln('Passed!');
  1608. { static method call }
  1609. clear_globals;
  1610. clear_values;
  1611. failed := false;
  1612. vmtclass:=theritedvmtclass.constructor_init;
  1613. Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
  1614. vmtclass.method_normal_call_static_params_mixed(RESULT_U8BIT,
  1615. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1616. if global_u8bit <> RESULT_U8BIT then
  1617. failed := true;
  1618. if global_u16bit <> RESULT_U16BIT then
  1619. failed := true;
  1620. if global_s32bit <> RESULT_S32BIT then
  1621. failed := true;
  1622. if global_s64bit <> RESULT_S64BIT then
  1623. failed := true;
  1624. if global_bigstring <> RESULT_BIGSTRING then
  1625. failed := true;
  1626. vmtclass.destructor_params_done;
  1627. if failed then
  1628. fail
  1629. else
  1630. Writeln('Passed!');
  1631. clear_globals;
  1632. clear_values;
  1633. failed := false;
  1634. vmtclass:=theritedvmtclass.constructor_init;
  1635. Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
  1636. value_u8bit := RESULT_U8BIT;
  1637. value_u16bit := RESULT_U16BIT;
  1638. value_bigstring := RESULT_BIGSTRING;
  1639. value_s32bit := RESULT_S32BIT;
  1640. value_s64bit := RESULT_S64BIT;
  1641. vmtclass.method_normal_call_static_params_mixed(value_u8bit,
  1642. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1643. if global_u8bit <> RESULT_U8BIT then
  1644. failed := true;
  1645. if global_u16bit <> RESULT_U16BIT then
  1646. failed := true;
  1647. if global_s32bit <> RESULT_S32BIT then
  1648. failed := true;
  1649. if global_s64bit <> RESULT_S64BIT then
  1650. failed := true;
  1651. if global_bigstring <> RESULT_BIGSTRING then
  1652. failed := true;
  1653. vmtclass.destructor_params_done;
  1654. if failed then
  1655. fail
  1656. else
  1657. Writeln('Passed!');
  1658. (* calls the inherited method *)
  1659. clear_globals;
  1660. clear_values;
  1661. failed := false;
  1662. { Calls the ancestor virtual method }
  1663. vmtclass:=theritedvmtclass.constructor_init;
  1664. Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
  1665. vmtclass.method_normal_call_inherited_params_mixed(RESULT_U8BIT,
  1666. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1667. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1668. failed := true;
  1669. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1670. failed := true;
  1671. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1672. failed := true;
  1673. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1674. failed := true;
  1675. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1676. failed := true;
  1677. vmtclass.destructor_params_done;
  1678. if failed then
  1679. fail
  1680. else
  1681. Writeln('Passed!');
  1682. clear_globals;
  1683. clear_values;
  1684. failed := false;
  1685. vmtclass:=theritedvmtclass.constructor_init;
  1686. Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
  1687. value_u8bit := RESULT_U8BIT;
  1688. value_u16bit := RESULT_U16BIT;
  1689. value_bigstring := RESULT_BIGSTRING;
  1690. value_s32bit := RESULT_S32BIT;
  1691. value_s64bit := RESULT_S64BIT;
  1692. vmtclass.method_normal_call_inherited_params_mixed(value_u8bit,
  1693. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1694. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1695. failed := true;
  1696. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1697. failed := true;
  1698. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1699. failed := true;
  1700. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1701. failed := true;
  1702. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1703. failed := true;
  1704. vmtclass.destructor_params_done;
  1705. if failed then
  1706. fail
  1707. else
  1708. Writeln('Passed!');
  1709. { ********************************************************************
  1710. This calls virtual methods which in turn call other methods,
  1711. or a constructor or a destructor.
  1712. *********************************************************************
  1713. }
  1714. clear_globals;
  1715. clear_values;
  1716. failed := false;
  1717. { Calls the ancestor virtual method }
  1718. vmtclass:=theritedvmtclass.constructor_init;
  1719. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  1720. vmtclass.method_virtual_call_virtual_params_mixed(RESULT_U8BIT,
  1721. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1722. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1723. failed := true;
  1724. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1725. failed := true;
  1726. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1727. failed := true;
  1728. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1729. failed := true;
  1730. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1731. failed := true;
  1732. vmtclass.destructor_params_done;
  1733. if failed then
  1734. fail
  1735. else
  1736. Writeln('Passed!');
  1737. clear_globals;
  1738. clear_values;
  1739. failed := false;
  1740. vmtclass:=theritedvmtclass.constructor_init;
  1741. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  1742. value_u8bit := RESULT_U8BIT;
  1743. value_u16bit := RESULT_U16BIT;
  1744. value_bigstring := RESULT_BIGSTRING;
  1745. value_s32bit := RESULT_S32BIT;
  1746. value_s64bit := RESULT_S64BIT;
  1747. vmtclass.method_virtual_call_virtual_params_mixed(value_u8bit,
  1748. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1749. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1750. failed := true;
  1751. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1752. failed := true;
  1753. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1754. failed := true;
  1755. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1756. failed := true;
  1757. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1758. failed := true;
  1759. vmtclass.destructor_params_done;
  1760. if failed then
  1761. fail
  1762. else
  1763. Writeln('Passed!');
  1764. { The virtual method has been overriden by the object in this case }
  1765. vmtclass:=theritedvmtclass.constructor_init;
  1766. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  1767. vmtclass.method_virtual_call_overriden_params_mixed(RESULT_U8BIT,
  1768. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1769. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1770. failed := true;
  1771. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1772. failed := true;
  1773. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1774. failed := true;
  1775. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1776. failed := true;
  1777. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1778. failed := true;
  1779. vmtclass.destructor_params_done;
  1780. if failed then
  1781. fail
  1782. else
  1783. Writeln('Passed!');
  1784. clear_globals;
  1785. clear_values;
  1786. failed := false;
  1787. vmtclass:=theritedvmtclass.constructor_init;
  1788. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  1789. value_u8bit := RESULT_U8BIT;
  1790. value_u16bit := RESULT_U16BIT;
  1791. value_bigstring := RESULT_BIGSTRING;
  1792. value_s32bit := RESULT_S32BIT;
  1793. value_s64bit := RESULT_S64BIT;
  1794. vmtclass.method_virtual_call_overriden_params_mixed(value_u8bit,
  1795. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1796. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1797. failed := true;
  1798. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1799. failed := true;
  1800. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1801. failed := true;
  1802. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1803. failed := true;
  1804. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1805. failed := true;
  1806. vmtclass.destructor_params_done;
  1807. if failed then
  1808. fail
  1809. else
  1810. Writeln('Passed!');
  1811. clear_globals;
  1812. clear_values;
  1813. failed := false;
  1814. vmtclass:=theritedvmtclass.constructor_init;
  1815. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
  1816. vmtclass.method_virtual_call_normal_params_mixed(RESULT_U8BIT,
  1817. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1818. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1819. failed := true;
  1820. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1821. failed := true;
  1822. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1823. failed := true;
  1824. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1825. failed := true;
  1826. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1827. failed := true;
  1828. vmtclass.destructor_params_done;
  1829. if failed then
  1830. fail
  1831. else
  1832. Writeln('Passed!');
  1833. clear_globals;
  1834. clear_values;
  1835. failed := false;
  1836. vmtclass:=theritedvmtclass.constructor_init;
  1837. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
  1838. value_u8bit := RESULT_U8BIT;
  1839. value_u16bit := RESULT_U16BIT;
  1840. value_bigstring := RESULT_BIGSTRING;
  1841. value_s32bit := RESULT_S32BIT;
  1842. value_s64bit := RESULT_S64BIT;
  1843. vmtclass.method_virtual_call_normal_params_mixed(value_u8bit,
  1844. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1845. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1846. failed := true;
  1847. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1848. failed := true;
  1849. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1850. failed := true;
  1851. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1852. failed := true;
  1853. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1854. failed := true;
  1855. vmtclass.destructor_params_done;
  1856. if failed then
  1857. fail
  1858. else
  1859. Writeln('Passed!');
  1860. (* destructor call inside a normal method *)
  1861. clear_globals;
  1862. clear_values;
  1863. failed := false;
  1864. vmtclass:=theritedvmtclass.constructor_params_mixed(RESULT_U8BIT,
  1865. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1866. Write('Testing virtual call w/destructor call...');
  1867. vmtclass.method_virtual_call_destructor;
  1868. if global_u8bit <> RESULT_U8BIT then
  1869. failed := true;
  1870. if global_u16bit <> RESULT_U16BIT then
  1871. failed := true;
  1872. if global_s32bit <> RESULT_S32BIT then
  1873. failed := true;
  1874. if global_s64bit <> RESULT_S64BIT then
  1875. failed := true;
  1876. if global_bigstring <> RESULT_BIGSTRING then
  1877. failed := true;
  1878. { already called by method_virtual_call_destructor above
  1879. vmtclass.destructor_params_done;
  1880. }
  1881. if failed then
  1882. fail
  1883. else
  1884. Writeln('Passed!');
  1885. (* constructor call inside a normal method *)
  1886. clear_globals;
  1887. clear_values;
  1888. failed := false;
  1889. vmtclass:=theritedvmtclass.constructor_init;
  1890. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
  1891. vmtclass.method_virtual_call_constructor_params_mixed(RESULT_U8BIT,
  1892. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1893. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1894. failed := true;
  1895. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1896. failed := true;
  1897. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1898. failed := true;
  1899. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1900. failed := true;
  1901. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1902. failed := true;
  1903. vmtclass.destructor_params_done;
  1904. if failed then
  1905. fail
  1906. else
  1907. Writeln('Passed!');
  1908. clear_globals;
  1909. clear_values;
  1910. failed := false;
  1911. vmtclass:=theritedvmtclass.constructor_init;
  1912. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
  1913. value_u8bit := RESULT_U8BIT;
  1914. value_u16bit := RESULT_U16BIT;
  1915. value_bigstring := RESULT_BIGSTRING;
  1916. value_s32bit := RESULT_S32BIT;
  1917. value_s64bit := RESULT_S64BIT;
  1918. vmtclass.method_virtual_call_constructor_params_mixed(value_u8bit,
  1919. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1920. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1921. failed := true;
  1922. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1923. failed := true;
  1924. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1925. failed := true;
  1926. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1927. failed := true;
  1928. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1929. failed := true;
  1930. vmtclass.destructor_params_done;
  1931. if failed then
  1932. fail
  1933. else
  1934. Writeln('Passed!');
  1935. (* static virtual call *)
  1936. clear_globals;
  1937. clear_values;
  1938. failed := false;
  1939. vmtclass:=theritedvmtclass.constructor_init;
  1940. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
  1941. vmtclass.method_virtual_call_static_params_mixed(RESULT_U8BIT,
  1942. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1943. if global_u8bit <> RESULT_U8BIT then
  1944. failed := true;
  1945. if global_u16bit <> RESULT_U16BIT then
  1946. failed := true;
  1947. if global_s32bit <> RESULT_S32BIT then
  1948. failed := true;
  1949. if global_s64bit <> RESULT_S64BIT then
  1950. failed := true;
  1951. if global_bigstring <> RESULT_BIGSTRING then
  1952. failed := true;
  1953. vmtclass.destructor_params_done;
  1954. if failed then
  1955. fail
  1956. else
  1957. Writeln('Passed!');
  1958. clear_globals;
  1959. clear_values;
  1960. failed := false;
  1961. vmtclass:=theritedvmtclass.constructor_init;
  1962. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
  1963. value_u8bit := RESULT_U8BIT;
  1964. value_u16bit := RESULT_U16BIT;
  1965. value_bigstring := RESULT_BIGSTRING;
  1966. value_s32bit := RESULT_S32BIT;
  1967. value_s64bit := RESULT_S64BIT;
  1968. vmtclass.method_virtual_call_static_params_mixed(value_u8bit,
  1969. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1970. if global_u8bit <> RESULT_U8BIT then
  1971. failed := true;
  1972. if global_u16bit <> RESULT_U16BIT then
  1973. failed := true;
  1974. if global_s32bit <> RESULT_S32BIT then
  1975. failed := true;
  1976. if global_s64bit <> RESULT_S64BIT then
  1977. failed := true;
  1978. if global_bigstring <> RESULT_BIGSTRING then
  1979. failed := true;
  1980. vmtclass.destructor_params_done;
  1981. if failed then
  1982. fail
  1983. else
  1984. Writeln('Passed!');
  1985. (* calls the inherited method *)
  1986. clear_globals;
  1987. clear_values;
  1988. failed := false;
  1989. { Calls the ancestor virtual method }
  1990. vmtclass:=theritedvmtclass.constructor_init;
  1991. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
  1992. vmtclass.method_virtual_call_inherited_params_mixed(RESULT_U8BIT,
  1993. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1994. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1995. failed := true;
  1996. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1997. failed := true;
  1998. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1999. failed := true;
  2000. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2001. failed := true;
  2002. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2003. failed := true;
  2004. vmtclass.destructor_params_done;
  2005. if failed then
  2006. fail
  2007. else
  2008. Writeln('Passed!');
  2009. clear_globals;
  2010. clear_values;
  2011. failed := false;
  2012. vmtclass:=theritedvmtclass.constructor_init;
  2013. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
  2014. value_u8bit := RESULT_U8BIT;
  2015. value_u16bit := RESULT_U16BIT;
  2016. value_bigstring := RESULT_BIGSTRING;
  2017. value_s32bit := RESULT_S32BIT;
  2018. value_s64bit := RESULT_S64BIT;
  2019. vmtclass.method_virtual_call_inherited_params_mixed(value_u8bit,
  2020. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2021. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2022. failed := true;
  2023. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2024. failed := true;
  2025. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2026. failed := true;
  2027. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2028. failed := true;
  2029. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2030. failed := true;
  2031. vmtclass.destructor_params_done;
  2032. if failed then
  2033. fail
  2034. else
  2035. Writeln('Passed!');
  2036. (* dynamic call testing *)
  2037. clear_globals;
  2038. clear_values;
  2039. failed := false;
  2040. vmtclass:=theritedvmtclass.constructor_init;
  2041. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/constructor call...');
  2042. vmtclass.method_dynamic_call_constructor_params_mixed(RESULT_U8BIT,
  2043. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2044. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2045. failed := true;
  2046. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2047. failed := true;
  2048. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2049. failed := true;
  2050. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2051. failed := true;
  2052. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2053. failed := true;
  2054. vmtclass.destructor_params_done;
  2055. if failed then
  2056. fail
  2057. else
  2058. Writeln('Passed!');
  2059. clear_globals;
  2060. clear_values;
  2061. failed := false;
  2062. vmtclass:=theritedvmtclass.constructor_init;
  2063. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/constructor call...');
  2064. value_u8bit := RESULT_U8BIT;
  2065. value_u16bit := RESULT_U16BIT;
  2066. value_bigstring := RESULT_BIGSTRING;
  2067. value_s32bit := RESULT_S32BIT;
  2068. value_s64bit := RESULT_S64BIT;
  2069. vmtclass.method_dynamic_call_constructor_params_mixed(value_u8bit,
  2070. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2071. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2072. failed := true;
  2073. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2074. failed := true;
  2075. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2076. failed := true;
  2077. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2078. failed := true;
  2079. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2080. failed := true;
  2081. vmtclass.destructor_params_done;
  2082. if failed then
  2083. fail
  2084. else
  2085. Writeln('Passed!');
  2086. (* static virtual call *)
  2087. clear_globals;
  2088. clear_values;
  2089. failed := false;
  2090. vmtclass:=theritedvmtclass.constructor_init;
  2091. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/static call...');
  2092. vmtclass.method_dynamic_call_static_params_mixed(RESULT_U8BIT,
  2093. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2094. if global_u8bit <> RESULT_U8BIT then
  2095. failed := true;
  2096. if global_u16bit <> RESULT_U16BIT then
  2097. failed := true;
  2098. if global_s32bit <> RESULT_S32BIT then
  2099. failed := true;
  2100. if global_s64bit <> RESULT_S64BIT then
  2101. failed := true;
  2102. if global_bigstring <> RESULT_BIGSTRING then
  2103. failed := true;
  2104. vmtclass.destructor_params_done;
  2105. if failed then
  2106. fail
  2107. else
  2108. Writeln('Passed!');
  2109. clear_globals;
  2110. clear_values;
  2111. failed := false;
  2112. vmtclass:=theritedvmtclass.constructor_init;
  2113. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/static call...');
  2114. value_u8bit := RESULT_U8BIT;
  2115. value_u16bit := RESULT_U16BIT;
  2116. value_bigstring := RESULT_BIGSTRING;
  2117. value_s32bit := RESULT_S32BIT;
  2118. value_s64bit := RESULT_S64BIT;
  2119. vmtclass.method_dynamic_call_static_params_mixed(value_u8bit,
  2120. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2121. if global_u8bit <> RESULT_U8BIT then
  2122. failed := true;
  2123. if global_u16bit <> RESULT_U16BIT then
  2124. failed := true;
  2125. if global_s32bit <> RESULT_S32BIT then
  2126. failed := true;
  2127. if global_s64bit <> RESULT_S64BIT then
  2128. failed := true;
  2129. if global_bigstring <> RESULT_BIGSTRING then
  2130. failed := true;
  2131. vmtclass.destructor_params_done;
  2132. if failed then
  2133. fail
  2134. else
  2135. Writeln('Passed!');
  2136. (* calls the inherited method *)
  2137. clear_globals;
  2138. clear_values;
  2139. failed := false;
  2140. { Calls the ancestor virtual method }
  2141. vmtclass:=theritedvmtclass.constructor_init;
  2142. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/inherited call...');
  2143. vmtclass.method_dynamic_call_inherited_params_mixed(RESULT_U8BIT,
  2144. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2145. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2146. failed := true;
  2147. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2148. failed := true;
  2149. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2150. failed := true;
  2151. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2152. failed := true;
  2153. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2154. failed := true;
  2155. vmtclass.destructor_params_done;
  2156. if failed then
  2157. fail
  2158. else
  2159. Writeln('Passed!');
  2160. clear_globals;
  2161. clear_values;
  2162. failed := false;
  2163. vmtclass:=theritedvmtclass.constructor_init;
  2164. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/inherited call...');
  2165. value_u8bit := RESULT_U8BIT;
  2166. value_u16bit := RESULT_U16BIT;
  2167. value_bigstring := RESULT_BIGSTRING;
  2168. value_s32bit := RESULT_S32BIT;
  2169. value_s64bit := RESULT_S64BIT;
  2170. vmtclass.method_dynamic_call_inherited_params_mixed(value_u8bit,
  2171. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2172. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2173. failed := true;
  2174. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2175. failed := true;
  2176. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2177. failed := true;
  2178. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2179. failed := true;
  2180. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2181. failed := true;
  2182. vmtclass.destructor_params_done;
  2183. if failed then
  2184. fail
  2185. else
  2186. Writeln('Passed!');
  2187. end;
  2188. procedure testwith;
  2189. var
  2190. vmtclass : theritedvmtclass;
  2191. failed : boolean;
  2192. begin
  2193. with vmtclass do
  2194. begin
  2195. {********************** CONSTRUCTOR TESTING ************************}
  2196. {********************** DESTRUCTOR TESTING ************************}
  2197. clear_globals;
  2198. clear_values;
  2199. failed := false;
  2200. Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
  2201. vmtclass := theritedvmtclass.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING,
  2202. RESULT_S32BIT, RESULT_S64BIT);
  2203. if object_u8bit <> RESULT_U8BIT then
  2204. failed := true;
  2205. if object_u16bit <> RESULT_U16BIT then
  2206. failed := true;
  2207. if object_s32bit <> RESULT_S32BIT then
  2208. failed := true;
  2209. if object_s64bit <> RESULT_S64BIT then
  2210. failed := true;
  2211. if object_bigstring <> RESULT_BIGSTRING then
  2212. failed := true;
  2213. destructor_params_done;
  2214. if failed then
  2215. fail
  2216. else
  2217. Writeln('Passed!');
  2218. clear_globals;
  2219. clear_values;
  2220. failed := false;
  2221. Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
  2222. value_u8bit := RESULT_U8BIT;
  2223. value_u16bit := RESULT_U16BIT;
  2224. value_bigstring := RESULT_BIGSTRING;
  2225. value_s32bit := RESULT_S32BIT;
  2226. value_s64bit := RESULT_S64BIT;
  2227. vmtclass := theritedvmtclass.constructor_params_mixed_call_inherited(value_u8bit,
  2228. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2229. if object_u8bit <> RESULT_U8BIT then
  2230. failed := true;
  2231. if object_u16bit <> RESULT_U16BIT then
  2232. failed := true;
  2233. if object_s32bit <> RESULT_S32BIT then
  2234. failed := true;
  2235. if object_s64bit <> RESULT_S64BIT then
  2236. failed := true;
  2237. if object_bigstring <> RESULT_BIGSTRING then
  2238. failed := true;
  2239. destructor_params_done;
  2240. if failed then
  2241. fail
  2242. else
  2243. Writeln('Passed!');
  2244. clear_globals;
  2245. clear_values;
  2246. failed := false;
  2247. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  2248. vmtclass := theritedvmtclass.constructor_params_mixed_call_virtual(RESULT_U8BIT,
  2249. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2250. if object_u8bit <> RESULT_U8BIT then
  2251. failed := true;
  2252. if object_u16bit <> RESULT_U16BIT then
  2253. failed := true;
  2254. if object_s32bit <> RESULT_S32BIT then
  2255. failed := true;
  2256. if object_s64bit <> RESULT_S64BIT then
  2257. failed := true;
  2258. if object_bigstring <> RESULT_BIGSTRING then
  2259. failed := true;
  2260. destructor_params_done;
  2261. if failed then
  2262. fail
  2263. else
  2264. Writeln('Passed!');
  2265. clear_globals;
  2266. clear_values;
  2267. failed := false;
  2268. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  2269. value_u8bit := RESULT_U8BIT;
  2270. value_u16bit := RESULT_U16BIT;
  2271. value_bigstring := RESULT_BIGSTRING;
  2272. value_s32bit := RESULT_S32BIT;
  2273. value_s64bit := RESULT_S64BIT;
  2274. vmtclass:=theritedvmtclass.constructor_params_mixed_call_virtual(value_u8bit,
  2275. value_u16bit, value_bigstring, value_s32bit, value_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. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  2295. vmtclass:=theritedvmtclass.constructor_params_mixed_call_overriden(RESULT_U8BIT,
  2296. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2297. if object_u8bit <> RESULT_U8BIT then
  2298. failed := true;
  2299. if object_u16bit <> RESULT_U16BIT then
  2300. failed := true;
  2301. if object_s32bit <> RESULT_S32BIT then
  2302. failed := true;
  2303. if object_s64bit <> RESULT_S64BIT then
  2304. failed := true;
  2305. if object_bigstring <> RESULT_BIGSTRING then
  2306. failed := true;
  2307. destructor_params_done;
  2308. if failed then
  2309. fail
  2310. else
  2311. Writeln('Passed!');
  2312. clear_globals;
  2313. clear_values;
  2314. failed := false;
  2315. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  2316. value_u8bit := RESULT_U8BIT;
  2317. value_u16bit := RESULT_U16BIT;
  2318. value_bigstring := RESULT_BIGSTRING;
  2319. value_s32bit := RESULT_S32BIT;
  2320. value_s64bit := RESULT_S64BIT;
  2321. vmtclass:=theritedvmtclass.constructor_params_mixed_call_overriden(value_u8bit,
  2322. value_u16bit, value_bigstring, value_s32bit, value_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. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
  2342. vmtclass:=theritedvmtclass.constructor_params_mixed_call_normal(RESULT_U8BIT,
  2343. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2344. if object_u8bit <> RESULT_U8BIT then
  2345. failed := true;
  2346. if object_u16bit <> RESULT_U16BIT then
  2347. failed := true;
  2348. if object_s32bit <> RESULT_S32BIT then
  2349. failed := true;
  2350. if object_s64bit <> RESULT_S64BIT then
  2351. failed := true;
  2352. if object_bigstring <> RESULT_BIGSTRING then
  2353. failed := true;
  2354. destructor_params_done;
  2355. if failed then
  2356. fail
  2357. else
  2358. Writeln('Passed!');
  2359. clear_globals;
  2360. clear_values;
  2361. failed := false;
  2362. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
  2363. value_u8bit := RESULT_U8BIT;
  2364. value_u16bit := RESULT_U16BIT;
  2365. value_bigstring := RESULT_BIGSTRING;
  2366. value_s32bit := RESULT_S32BIT;
  2367. value_s64bit := RESULT_S64BIT;
  2368. vmtclass:=theritedvmtclass.constructor_params_mixed_call_normal(value_u8bit,
  2369. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2370. if object_u8bit <> RESULT_U8BIT then
  2371. failed := true;
  2372. if object_u16bit <> RESULT_U16BIT then
  2373. failed := true;
  2374. if object_s32bit <> RESULT_S32BIT then
  2375. failed := true;
  2376. if object_s64bit <> RESULT_S64BIT then
  2377. failed := true;
  2378. if object_bigstring <> RESULT_BIGSTRING then
  2379. failed := true;
  2380. destructor_params_done;
  2381. if failed then
  2382. fail
  2383. else
  2384. Writeln('Passed!');
  2385. clear_globals;
  2386. clear_values;
  2387. failed := false;
  2388. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
  2389. vmtclass:=theritedvmtclass.constructor_params_mixed_call_static(RESULT_U8BIT,
  2390. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2391. if global_u8bit <> RESULT_U8BIT then
  2392. failed := true;
  2393. if global_u16bit <> RESULT_U16BIT then
  2394. failed := true;
  2395. if global_s32bit <> RESULT_S32BIT then
  2396. failed := true;
  2397. if global_s64bit <> RESULT_S64BIT then
  2398. failed := true;
  2399. if global_bigstring <> RESULT_BIGSTRING then
  2400. failed := true;
  2401. destructor_params_done;
  2402. if failed then
  2403. fail
  2404. else
  2405. Writeln('Passed!');
  2406. clear_globals;
  2407. clear_values;
  2408. failed := false;
  2409. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
  2410. value_u8bit := RESULT_U8BIT;
  2411. value_u16bit := RESULT_U16BIT;
  2412. value_bigstring := RESULT_BIGSTRING;
  2413. value_s32bit := RESULT_S32BIT;
  2414. value_s64bit := RESULT_S64BIT;
  2415. vmtclass:=theritedvmtclass.constructor_params_mixed_call_static(value_u8bit,
  2416. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2417. if global_u8bit <> RESULT_U8BIT then
  2418. failed := true;
  2419. if global_u16bit <> RESULT_U16BIT then
  2420. failed := true;
  2421. if global_s32bit <> RESULT_S32BIT then
  2422. failed := true;
  2423. if global_s64bit <> RESULT_S64BIT then
  2424. failed := true;
  2425. if global_bigstring <> RESULT_BIGSTRING then
  2426. failed := true;
  2427. destructor_params_done;
  2428. if failed then
  2429. fail
  2430. else
  2431. Writeln('Passed!');
  2432. {************************* METHOD TESTING **************************}
  2433. clear_globals;
  2434. clear_values;
  2435. failed := false;
  2436. vmtclass:=theritedvmtclass.constructor_init;
  2437. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  2438. method_virtual_params_mixed(RESULT_U8BIT,
  2439. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2440. if object_u8bit <> RESULT_U8BIT then
  2441. failed := true;
  2442. if object_u16bit <> RESULT_U16BIT then
  2443. failed := true;
  2444. if object_s32bit <> RESULT_S32BIT then
  2445. failed := true;
  2446. if object_s64bit <> RESULT_S64BIT then
  2447. failed := true;
  2448. if object_bigstring <> RESULT_BIGSTRING then
  2449. failed := true;
  2450. destructor_params_done;
  2451. if failed then
  2452. fail
  2453. else
  2454. Writeln('Passed!');
  2455. clear_globals;
  2456. clear_values;
  2457. failed := false;
  2458. vmtclass:=theritedvmtclass.constructor_init;
  2459. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  2460. value_u8bit := RESULT_U8BIT;
  2461. value_u16bit := RESULT_U16BIT;
  2462. value_bigstring := RESULT_BIGSTRING;
  2463. value_s32bit := RESULT_S32BIT;
  2464. value_s64bit := RESULT_S64BIT;
  2465. method_virtual_params_mixed(value_u8bit,
  2466. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2467. if object_u8bit <> RESULT_U8BIT then
  2468. failed := true;
  2469. if object_u16bit <> RESULT_U16BIT then
  2470. failed := true;
  2471. if object_s32bit <> RESULT_S32BIT then
  2472. failed := true;
  2473. if object_s64bit <> RESULT_S64BIT then
  2474. failed := true;
  2475. if object_bigstring <> RESULT_BIGSTRING then
  2476. failed := true;
  2477. destructor_params_done;
  2478. if failed then
  2479. fail
  2480. else
  2481. Writeln('Passed!');
  2482. clear_globals;
  2483. clear_values;
  2484. failed := false;
  2485. vmtclass:=theritedvmtclass.constructor_init;
  2486. Write('Testing mixed parameter (LOC_CONSTANT) dynamic method call...');
  2487. method_dynamic_params_mixed(RESULT_U8BIT,
  2488. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2489. if object_u8bit <> RESULT_U8BIT then
  2490. failed := true;
  2491. if object_u16bit <> RESULT_U16BIT then
  2492. failed := true;
  2493. if object_s32bit <> RESULT_S32BIT then
  2494. failed := true;
  2495. if object_s64bit <> RESULT_S64BIT then
  2496. failed := true;
  2497. if object_bigstring <> RESULT_BIGSTRING then
  2498. failed := true;
  2499. destructor_params_done;
  2500. if failed then
  2501. fail
  2502. else
  2503. Writeln('Passed!');
  2504. clear_globals;
  2505. clear_values;
  2506. failed := false;
  2507. vmtclass:=theritedvmtclass.constructor_init;
  2508. Write('Testing mixed parameter (LOC_CONSTANT) dynamic method call...');
  2509. method_dynamic_overriden_params_mixed(RESULT_U8BIT,
  2510. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2511. if object_u8bit <> RESULT_U8BIT then
  2512. failed := true;
  2513. if object_u16bit <> RESULT_U16BIT then
  2514. failed := true;
  2515. if object_s32bit <> RESULT_S32BIT then
  2516. failed := true;
  2517. if object_s64bit <> RESULT_S64BIT then
  2518. failed := true;
  2519. if object_bigstring <> RESULT_BIGSTRING then
  2520. failed := true;
  2521. destructor_params_done;
  2522. if failed then
  2523. fail
  2524. else
  2525. Writeln('Passed!');
  2526. clear_globals;
  2527. clear_values;
  2528. failed := false;
  2529. vmtclass:=theritedvmtclass.constructor_init;
  2530. Write('Testing mixed parameter (LOC_REFERENCE) dynamic method call...');
  2531. value_u8bit := RESULT_U8BIT;
  2532. value_u16bit := RESULT_U16BIT;
  2533. value_bigstring := RESULT_BIGSTRING;
  2534. value_s32bit := RESULT_S32BIT;
  2535. value_s64bit := RESULT_S64BIT;
  2536. method_dynamic_overriden_params_mixed(value_u8bit,
  2537. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2538. if object_u8bit <> RESULT_U8BIT then
  2539. failed := true;
  2540. if object_u16bit <> RESULT_U16BIT then
  2541. failed := true;
  2542. if object_s32bit <> RESULT_S32BIT then
  2543. failed := true;
  2544. if object_s64bit <> RESULT_S64BIT then
  2545. failed := true;
  2546. if object_bigstring <> RESULT_BIGSTRING then
  2547. failed := true;
  2548. destructor_params_done;
  2549. if failed then
  2550. fail
  2551. else
  2552. Writeln('Passed!');
  2553. clear_globals;
  2554. clear_values;
  2555. failed := false;
  2556. vmtclass:=theritedvmtclass.constructor_init;
  2557. Write('Testing mixed parameter (LOC_REFERENCE) dynamic method call...');
  2558. value_u8bit := RESULT_U8BIT;
  2559. value_u16bit := RESULT_U16BIT;
  2560. value_bigstring := RESULT_BIGSTRING;
  2561. value_s32bit := RESULT_S32BIT;
  2562. value_s64bit := RESULT_S64BIT;
  2563. method_dynamic_params_mixed(value_u8bit,
  2564. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2565. if object_u8bit <> RESULT_U8BIT then
  2566. failed := true;
  2567. if object_u16bit <> RESULT_U16BIT then
  2568. failed := true;
  2569. if object_s32bit <> RESULT_S32BIT then
  2570. failed := true;
  2571. if object_s64bit <> RESULT_S64BIT then
  2572. failed := true;
  2573. if object_bigstring <> RESULT_BIGSTRING then
  2574. failed := true;
  2575. destructor_params_done;
  2576. if failed then
  2577. fail
  2578. else
  2579. Writeln('Passed!');
  2580. clear_globals;
  2581. clear_values;
  2582. failed := false;
  2583. vmtclass:=theritedvmtclass.constructor_init;
  2584. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  2585. method_virtual_overriden_params_mixed(RESULT_U8BIT,
  2586. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2587. if object_u8bit <> RESULT_U8BIT then
  2588. failed := true;
  2589. if object_u16bit <> RESULT_U16BIT then
  2590. failed := true;
  2591. if object_s32bit <> RESULT_S32BIT then
  2592. failed := true;
  2593. if object_s64bit <> RESULT_S64BIT then
  2594. failed := true;
  2595. if object_bigstring <> RESULT_BIGSTRING then
  2596. failed := true;
  2597. destructor_params_done;
  2598. if failed then
  2599. fail
  2600. else
  2601. Writeln('Passed!');
  2602. clear_globals;
  2603. clear_values;
  2604. failed := false;
  2605. vmtclass:=theritedvmtclass.constructor_init;
  2606. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  2607. value_u8bit := RESULT_U8BIT;
  2608. value_u16bit := RESULT_U16BIT;
  2609. value_bigstring := RESULT_BIGSTRING;
  2610. value_s32bit := RESULT_S32BIT;
  2611. value_s64bit := RESULT_S64BIT;
  2612. method_virtual_overriden_params_mixed(value_u8bit,
  2613. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2614. if object_u8bit <> RESULT_U8BIT then
  2615. failed := true;
  2616. if object_u16bit <> RESULT_U16BIT then
  2617. failed := true;
  2618. if object_s32bit <> RESULT_S32BIT then
  2619. failed := true;
  2620. if object_s64bit <> RESULT_S64BIT then
  2621. failed := true;
  2622. if object_bigstring <> RESULT_BIGSTRING then
  2623. failed := true;
  2624. destructor_params_done;
  2625. if failed then
  2626. fail
  2627. else
  2628. Writeln('Passed!');
  2629. clear_globals;
  2630. clear_values;
  2631. failed := false;
  2632. vmtclass:=theritedvmtclass.constructor_init;
  2633. Write('Testing mixed parameter (LOC_CONSTANT) method call...');
  2634. method_normal_params_mixed(RESULT_U8BIT,
  2635. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2636. if object_u8bit <> RESULT_U8BIT then
  2637. failed := true;
  2638. if object_u16bit <> RESULT_U16BIT then
  2639. failed := true;
  2640. if object_s32bit <> RESULT_S32BIT then
  2641. failed := true;
  2642. if object_s64bit <> RESULT_S64BIT then
  2643. failed := true;
  2644. if object_bigstring <> RESULT_BIGSTRING then
  2645. failed := true;
  2646. destructor_params_done;
  2647. if failed then
  2648. fail
  2649. else
  2650. Writeln('Passed!');
  2651. clear_globals;
  2652. clear_values;
  2653. failed := false;
  2654. vmtclass:=theritedvmtclass.constructor_init;
  2655. Write('Testing mixed parameter (LOC_REFERENCE) method call...');
  2656. value_u8bit := RESULT_U8BIT;
  2657. value_u16bit := RESULT_U16BIT;
  2658. value_bigstring := RESULT_BIGSTRING;
  2659. value_s32bit := RESULT_S32BIT;
  2660. value_s64bit := RESULT_S64BIT;
  2661. method_normal_params_mixed(value_u8bit,
  2662. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2663. if object_u8bit <> RESULT_U8BIT then
  2664. failed := true;
  2665. if object_u16bit <> RESULT_U16BIT then
  2666. failed := true;
  2667. if object_s32bit <> RESULT_S32BIT then
  2668. failed := true;
  2669. if object_s64bit <> RESULT_S64BIT then
  2670. failed := true;
  2671. if object_bigstring <> RESULT_BIGSTRING then
  2672. failed := true;
  2673. destructor_params_done;
  2674. if failed then
  2675. fail
  2676. else
  2677. Writeln('Passed!');
  2678. clear_globals;
  2679. clear_values;
  2680. failed := false;
  2681. vmtclass:=theritedvmtclass.constructor_init;
  2682. Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
  2683. method_static_params_mixed(RESULT_U8BIT,
  2684. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2685. if global_u8bit <> RESULT_U8BIT then
  2686. failed := true;
  2687. if global_u16bit <> RESULT_U16BIT then
  2688. failed := true;
  2689. if global_s32bit <> RESULT_S32BIT then
  2690. failed := true;
  2691. if global_s64bit <> RESULT_S64BIT then
  2692. failed := true;
  2693. if global_bigstring <> RESULT_BIGSTRING then
  2694. failed := true;
  2695. destructor_params_done;
  2696. if failed then
  2697. fail
  2698. else
  2699. Writeln('Passed!');
  2700. clear_globals;
  2701. clear_values;
  2702. failed := false;
  2703. vmtclass:=theritedvmtclass.constructor_init;
  2704. Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
  2705. value_u8bit := RESULT_U8BIT;
  2706. value_u16bit := RESULT_U16BIT;
  2707. value_bigstring := RESULT_BIGSTRING;
  2708. value_s32bit := RESULT_S32BIT;
  2709. value_s64bit := RESULT_S64BIT;
  2710. method_static_params_mixed(value_u8bit,
  2711. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2712. if global_u8bit <> RESULT_U8BIT then
  2713. failed := true;
  2714. if global_u16bit <> RESULT_U16BIT then
  2715. failed := true;
  2716. if global_s32bit <> RESULT_S32BIT then
  2717. failed := true;
  2718. if global_s64bit <> RESULT_S64BIT then
  2719. failed := true;
  2720. if global_bigstring <> RESULT_BIGSTRING then
  2721. failed := true;
  2722. destructor_params_done;
  2723. if failed then
  2724. fail
  2725. else
  2726. Writeln('Passed!');
  2727. { ********************************************************************
  2728. This calls methods which in turn call other methods, or a constructor
  2729. or a destructor.
  2730. *********************************************************************
  2731. }
  2732. clear_globals;
  2733. clear_values;
  2734. failed := false;
  2735. { Calls the ancestor virtual method }
  2736. vmtclass:=theritedvmtclass.constructor_init;
  2737. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  2738. method_normal_call_virtual_params_mixed(RESULT_U8BIT,
  2739. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2740. if object_u8bit <> RESULT_U8BIT then
  2741. failed := true;
  2742. if object_u16bit <> RESULT_U16BIT then
  2743. failed := true;
  2744. if object_s32bit <> RESULT_S32BIT then
  2745. failed := true;
  2746. if object_s64bit <> RESULT_S64BIT then
  2747. failed := true;
  2748. if object_bigstring <> RESULT_BIGSTRING then
  2749. failed := true;
  2750. destructor_params_done;
  2751. if failed then
  2752. fail
  2753. else
  2754. Writeln('Passed!');
  2755. clear_globals;
  2756. clear_values;
  2757. failed := false;
  2758. vmtclass:=theritedvmtclass.constructor_init;
  2759. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  2760. value_u8bit := RESULT_U8BIT;
  2761. value_u16bit := RESULT_U16BIT;
  2762. value_bigstring := RESULT_BIGSTRING;
  2763. value_s32bit := RESULT_S32BIT;
  2764. value_s64bit := RESULT_S64BIT;
  2765. method_normal_call_virtual_params_mixed(value_u8bit,
  2766. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2767. if object_u8bit <> RESULT_U8BIT then
  2768. failed := true;
  2769. if object_u16bit <> RESULT_U16BIT then
  2770. failed := true;
  2771. if object_s32bit <> RESULT_S32BIT then
  2772. failed := true;
  2773. if object_s64bit <> RESULT_S64BIT then
  2774. failed := true;
  2775. if object_bigstring <> RESULT_BIGSTRING then
  2776. failed := true;
  2777. destructor_params_done;
  2778. if failed then
  2779. fail
  2780. else
  2781. Writeln('Passed!');
  2782. { The virtual method has been overriden by the object in this case }
  2783. vmtclass:=theritedvmtclass.constructor_init;
  2784. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  2785. method_normal_call_overriden_params_mixed(RESULT_U8BIT,
  2786. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2787. if object_u8bit <> RESULT_U8BIT then
  2788. failed := true;
  2789. if object_u16bit <> RESULT_U16BIT then
  2790. failed := true;
  2791. if object_s32bit <> RESULT_S32BIT then
  2792. failed := true;
  2793. if object_s64bit <> RESULT_S64BIT then
  2794. failed := true;
  2795. if object_bigstring <> RESULT_BIGSTRING then
  2796. failed := true;
  2797. destructor_params_done;
  2798. if failed then
  2799. fail
  2800. else
  2801. Writeln('Passed!');
  2802. clear_globals;
  2803. clear_values;
  2804. failed := false;
  2805. vmtclass:=theritedvmtclass.constructor_init;
  2806. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  2807. value_u8bit := RESULT_U8BIT;
  2808. value_u16bit := RESULT_U16BIT;
  2809. value_bigstring := RESULT_BIGSTRING;
  2810. value_s32bit := RESULT_S32BIT;
  2811. value_s64bit := RESULT_S64BIT;
  2812. method_normal_call_overriden_params_mixed(value_u8bit,
  2813. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2814. if object_u8bit <> RESULT_U8BIT then
  2815. failed := true;
  2816. if object_u16bit <> RESULT_U16BIT then
  2817. failed := true;
  2818. if object_s32bit <> RESULT_S32BIT then
  2819. failed := true;
  2820. if object_s64bit <> RESULT_S64BIT then
  2821. failed := true;
  2822. if object_bigstring <> RESULT_BIGSTRING then
  2823. failed := true;
  2824. destructor_params_done;
  2825. if failed then
  2826. fail
  2827. else
  2828. Writeln('Passed!');
  2829. clear_globals;
  2830. clear_values;
  2831. failed := false;
  2832. vmtclass:=theritedvmtclass.constructor_init;
  2833. Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
  2834. method_normal_call_normal_params_mixed(RESULT_U8BIT,
  2835. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2836. if object_u8bit <> RESULT_U8BIT then
  2837. failed := true;
  2838. if object_u16bit <> RESULT_U16BIT then
  2839. failed := true;
  2840. if object_s32bit <> RESULT_S32BIT then
  2841. failed := true;
  2842. if object_s64bit <> RESULT_S64BIT then
  2843. failed := true;
  2844. if object_bigstring <> RESULT_BIGSTRING then
  2845. failed := true;
  2846. destructor_params_done;
  2847. if failed then
  2848. fail
  2849. else
  2850. Writeln('Passed!');
  2851. clear_globals;
  2852. clear_values;
  2853. failed := false;
  2854. vmtclass:=theritedvmtclass.constructor_init;
  2855. Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
  2856. value_u8bit := RESULT_U8BIT;
  2857. value_u16bit := RESULT_U16BIT;
  2858. value_bigstring := RESULT_BIGSTRING;
  2859. value_s32bit := RESULT_S32BIT;
  2860. value_s64bit := RESULT_S64BIT;
  2861. method_normal_call_normal_params_mixed(value_u8bit,
  2862. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2863. if object_u8bit <> RESULT_U8BIT then
  2864. failed := true;
  2865. if object_u16bit <> RESULT_U16BIT then
  2866. failed := true;
  2867. if object_s32bit <> RESULT_S32BIT then
  2868. failed := true;
  2869. if object_s64bit <> RESULT_S64BIT then
  2870. failed := true;
  2871. if object_bigstring <> RESULT_BIGSTRING then
  2872. failed := true;
  2873. destructor_params_done;
  2874. if failed then
  2875. fail
  2876. else
  2877. Writeln('Passed!');
  2878. (* constructor call inside a normal method *)
  2879. clear_globals;
  2880. clear_values;
  2881. failed := false;
  2882. vmtclass:=theritedvmtclass.constructor_init;
  2883. Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
  2884. method_normal_call_constructor_params_mixed(RESULT_U8BIT,
  2885. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2886. if object_u8bit <> RESULT_U8BIT then
  2887. failed := true;
  2888. if object_u16bit <> RESULT_U16BIT then
  2889. failed := true;
  2890. if object_s32bit <> RESULT_S32BIT then
  2891. failed := true;
  2892. if object_s64bit <> RESULT_S64BIT then
  2893. failed := true;
  2894. if object_bigstring <> RESULT_BIGSTRING then
  2895. failed := true;
  2896. destructor_params_done;
  2897. if failed then
  2898. fail
  2899. else
  2900. Writeln('Passed!');
  2901. clear_globals;
  2902. clear_values;
  2903. failed := false;
  2904. vmtclass:=theritedvmtclass.constructor_init;
  2905. Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
  2906. value_u8bit := RESULT_U8BIT;
  2907. value_u16bit := RESULT_U16BIT;
  2908. value_bigstring := RESULT_BIGSTRING;
  2909. value_s32bit := RESULT_S32BIT;
  2910. value_s64bit := RESULT_S64BIT;
  2911. method_normal_call_constructor_params_mixed(value_u8bit,
  2912. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2913. if object_u8bit <> RESULT_U8BIT then
  2914. failed := true;
  2915. if object_u16bit <> RESULT_U16BIT then
  2916. failed := true;
  2917. if object_s32bit <> RESULT_S32BIT then
  2918. failed := true;
  2919. if object_s64bit <> RESULT_S64BIT then
  2920. failed := true;
  2921. if object_bigstring <> RESULT_BIGSTRING then
  2922. failed := true;
  2923. destructor_params_done;
  2924. if failed then
  2925. fail
  2926. else
  2927. Writeln('Passed!');
  2928. { static method call }
  2929. clear_globals;
  2930. clear_values;
  2931. failed := false;
  2932. vmtclass:=theritedvmtclass.constructor_init;
  2933. Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
  2934. method_normal_call_static_params_mixed(RESULT_U8BIT,
  2935. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2936. if global_u8bit <> RESULT_U8BIT then
  2937. failed := true;
  2938. if global_u16bit <> RESULT_U16BIT then
  2939. failed := true;
  2940. if global_s32bit <> RESULT_S32BIT then
  2941. failed := true;
  2942. if global_s64bit <> RESULT_S64BIT then
  2943. failed := true;
  2944. if global_bigstring <> RESULT_BIGSTRING then
  2945. failed := true;
  2946. destructor_params_done;
  2947. if failed then
  2948. fail
  2949. else
  2950. Writeln('Passed!');
  2951. clear_globals;
  2952. clear_values;
  2953. failed := false;
  2954. vmtclass:=theritedvmtclass.constructor_init;
  2955. Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
  2956. value_u8bit := RESULT_U8BIT;
  2957. value_u16bit := RESULT_U16BIT;
  2958. value_bigstring := RESULT_BIGSTRING;
  2959. value_s32bit := RESULT_S32BIT;
  2960. value_s64bit := RESULT_S64BIT;
  2961. method_normal_call_static_params_mixed(value_u8bit,
  2962. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2963. if global_u8bit <> RESULT_U8BIT then
  2964. failed := true;
  2965. if global_u16bit <> RESULT_U16BIT then
  2966. failed := true;
  2967. if global_s32bit <> RESULT_S32BIT then
  2968. failed := true;
  2969. if global_s64bit <> RESULT_S64BIT then
  2970. failed := true;
  2971. if global_bigstring <> RESULT_BIGSTRING then
  2972. failed := true;
  2973. destructor_params_done;
  2974. if failed then
  2975. fail
  2976. else
  2977. Writeln('Passed!');
  2978. (* calls the inherited method *)
  2979. clear_globals;
  2980. clear_values;
  2981. failed := false;
  2982. { Calls the ancestor virtual method }
  2983. vmtclass:=theritedvmtclass.constructor_init;
  2984. Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
  2985. method_normal_call_inherited_params_mixed(RESULT_U8BIT,
  2986. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2987. if object_u8bit <> RESULT_U8BIT then
  2988. failed := true;
  2989. if object_u16bit <> RESULT_U16BIT then
  2990. failed := true;
  2991. if object_s32bit <> RESULT_S32BIT then
  2992. failed := true;
  2993. if object_s64bit <> RESULT_S64BIT then
  2994. failed := true;
  2995. if object_bigstring <> RESULT_BIGSTRING then
  2996. failed := true;
  2997. destructor_params_done;
  2998. if failed then
  2999. fail
  3000. else
  3001. Writeln('Passed!');
  3002. clear_globals;
  3003. clear_values;
  3004. failed := false;
  3005. vmtclass:=theritedvmtclass.constructor_init;
  3006. Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
  3007. value_u8bit := RESULT_U8BIT;
  3008. value_u16bit := RESULT_U16BIT;
  3009. value_bigstring := RESULT_BIGSTRING;
  3010. value_s32bit := RESULT_S32BIT;
  3011. value_s64bit := RESULT_S64BIT;
  3012. method_normal_call_inherited_params_mixed(value_u8bit,
  3013. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3014. if object_u8bit <> RESULT_U8BIT then
  3015. failed := true;
  3016. if object_u16bit <> RESULT_U16BIT then
  3017. failed := true;
  3018. if object_s32bit <> RESULT_S32BIT then
  3019. failed := true;
  3020. if object_s64bit <> RESULT_S64BIT then
  3021. failed := true;
  3022. if object_bigstring <> RESULT_BIGSTRING then
  3023. failed := true;
  3024. destructor_params_done;
  3025. if failed then
  3026. fail
  3027. else
  3028. Writeln('Passed!');
  3029. { ********************************************************************
  3030. This calls virtual methods which in turn call other methods,
  3031. or a constructor or a destructor.
  3032. *********************************************************************
  3033. }
  3034. clear_globals;
  3035. clear_values;
  3036. failed := false;
  3037. { Calls the ancestor virtual method }
  3038. vmtclass:=theritedvmtclass.constructor_init;
  3039. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  3040. method_virtual_call_virtual_params_mixed(RESULT_U8BIT,
  3041. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3042. if object_u8bit <> RESULT_U8BIT then
  3043. failed := true;
  3044. if object_u16bit <> RESULT_U16BIT then
  3045. failed := true;
  3046. if object_s32bit <> RESULT_S32BIT then
  3047. failed := true;
  3048. if object_s64bit <> RESULT_S64BIT then
  3049. failed := true;
  3050. if object_bigstring <> RESULT_BIGSTRING then
  3051. failed := true;
  3052. destructor_params_done;
  3053. if failed then
  3054. fail
  3055. else
  3056. Writeln('Passed!');
  3057. clear_globals;
  3058. clear_values;
  3059. failed := false;
  3060. vmtclass:=theritedvmtclass.constructor_init;
  3061. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  3062. value_u8bit := RESULT_U8BIT;
  3063. value_u16bit := RESULT_U16BIT;
  3064. value_bigstring := RESULT_BIGSTRING;
  3065. value_s32bit := RESULT_S32BIT;
  3066. value_s64bit := RESULT_S64BIT;
  3067. method_virtual_call_virtual_params_mixed(value_u8bit,
  3068. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3069. if object_u8bit <> RESULT_U8BIT then
  3070. failed := true;
  3071. if object_u16bit <> RESULT_U16BIT then
  3072. failed := true;
  3073. if object_s32bit <> RESULT_S32BIT then
  3074. failed := true;
  3075. if object_s64bit <> RESULT_S64BIT then
  3076. failed := true;
  3077. if object_bigstring <> RESULT_BIGSTRING then
  3078. failed := true;
  3079. destructor_params_done;
  3080. if failed then
  3081. fail
  3082. else
  3083. Writeln('Passed!');
  3084. { The virtual method has been overriden by the object in this case }
  3085. vmtclass:=theritedvmtclass.constructor_init;
  3086. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  3087. method_virtual_call_overriden_params_mixed(RESULT_U8BIT,
  3088. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3089. if object_u8bit <> RESULT_U8BIT then
  3090. failed := true;
  3091. if object_u16bit <> RESULT_U16BIT then
  3092. failed := true;
  3093. if object_s32bit <> RESULT_S32BIT then
  3094. failed := true;
  3095. if object_s64bit <> RESULT_S64BIT then
  3096. failed := true;
  3097. if object_bigstring <> RESULT_BIGSTRING then
  3098. failed := true;
  3099. destructor_params_done;
  3100. if failed then
  3101. fail
  3102. else
  3103. Writeln('Passed!');
  3104. clear_globals;
  3105. clear_values;
  3106. failed := false;
  3107. vmtclass:=theritedvmtclass.constructor_init;
  3108. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  3109. value_u8bit := RESULT_U8BIT;
  3110. value_u16bit := RESULT_U16BIT;
  3111. value_bigstring := RESULT_BIGSTRING;
  3112. value_s32bit := RESULT_S32BIT;
  3113. value_s64bit := RESULT_S64BIT;
  3114. method_virtual_call_overriden_params_mixed(value_u8bit,
  3115. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3116. if object_u8bit <> RESULT_U8BIT then
  3117. failed := true;
  3118. if object_u16bit <> RESULT_U16BIT then
  3119. failed := true;
  3120. if object_s32bit <> RESULT_S32BIT then
  3121. failed := true;
  3122. if object_s64bit <> RESULT_S64BIT then
  3123. failed := true;
  3124. if object_bigstring <> RESULT_BIGSTRING then
  3125. failed := true;
  3126. destructor_params_done;
  3127. if failed then
  3128. fail
  3129. else
  3130. Writeln('Passed!');
  3131. clear_globals;
  3132. clear_values;
  3133. failed := false;
  3134. vmtclass:=theritedvmtclass.constructor_init;
  3135. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
  3136. method_virtual_call_normal_params_mixed(RESULT_U8BIT,
  3137. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3138. if object_u8bit <> RESULT_U8BIT then
  3139. failed := true;
  3140. if object_u16bit <> RESULT_U16BIT then
  3141. failed := true;
  3142. if object_s32bit <> RESULT_S32BIT then
  3143. failed := true;
  3144. if object_s64bit <> RESULT_S64BIT then
  3145. failed := true;
  3146. if object_bigstring <> RESULT_BIGSTRING then
  3147. failed := true;
  3148. destructor_params_done;
  3149. if failed then
  3150. fail
  3151. else
  3152. Writeln('Passed!');
  3153. clear_globals;
  3154. clear_values;
  3155. failed := false;
  3156. vmtclass:=theritedvmtclass.constructor_init;
  3157. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
  3158. value_u8bit := RESULT_U8BIT;
  3159. value_u16bit := RESULT_U16BIT;
  3160. value_bigstring := RESULT_BIGSTRING;
  3161. value_s32bit := RESULT_S32BIT;
  3162. value_s64bit := RESULT_S64BIT;
  3163. method_virtual_call_normal_params_mixed(value_u8bit,
  3164. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3165. if object_u8bit <> RESULT_U8BIT then
  3166. failed := true;
  3167. if object_u16bit <> RESULT_U16BIT then
  3168. failed := true;
  3169. if object_s32bit <> RESULT_S32BIT then
  3170. failed := true;
  3171. if object_s64bit <> RESULT_S64BIT then
  3172. failed := true;
  3173. if object_bigstring <> RESULT_BIGSTRING then
  3174. failed := true;
  3175. destructor_params_done;
  3176. if failed then
  3177. fail
  3178. else
  3179. Writeln('Passed!');
  3180. (* destructor call inside a normal method *)
  3181. clear_globals;
  3182. clear_values;
  3183. failed := false;
  3184. vmtclass:=theritedvmtclass.constructor_params_mixed(RESULT_U8BIT,
  3185. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3186. Write('Testing virtual call w/destructor call...');
  3187. method_virtual_call_destructor;
  3188. if global_u8bit <> RESULT_U8BIT then
  3189. failed := true;
  3190. if global_u16bit <> RESULT_U16BIT then
  3191. failed := true;
  3192. if global_s32bit <> RESULT_S32BIT then
  3193. failed := true;
  3194. if global_s64bit <> RESULT_S64BIT then
  3195. failed := true;
  3196. if global_bigstring <> RESULT_BIGSTRING then
  3197. failed := true;
  3198. { already called by method_virtual_call_destructor above
  3199. destructor_params_done;
  3200. }
  3201. if failed then
  3202. fail
  3203. else
  3204. Writeln('Passed!');
  3205. (* constructor call inside a normal method *)
  3206. clear_globals;
  3207. clear_values;
  3208. failed := false;
  3209. vmtclass:=theritedvmtclass.constructor_init;
  3210. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
  3211. method_virtual_call_constructor_params_mixed(RESULT_U8BIT,
  3212. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3213. if object_u8bit <> RESULT_U8BIT then
  3214. failed := true;
  3215. if object_u16bit <> RESULT_U16BIT then
  3216. failed := true;
  3217. if object_s32bit <> RESULT_S32BIT then
  3218. failed := true;
  3219. if object_s64bit <> RESULT_S64BIT then
  3220. failed := true;
  3221. if object_bigstring <> RESULT_BIGSTRING then
  3222. failed := true;
  3223. destructor_params_done;
  3224. if failed then
  3225. fail
  3226. else
  3227. Writeln('Passed!');
  3228. clear_globals;
  3229. clear_values;
  3230. failed := false;
  3231. vmtclass:=theritedvmtclass.constructor_init;
  3232. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
  3233. value_u8bit := RESULT_U8BIT;
  3234. value_u16bit := RESULT_U16BIT;
  3235. value_bigstring := RESULT_BIGSTRING;
  3236. value_s32bit := RESULT_S32BIT;
  3237. value_s64bit := RESULT_S64BIT;
  3238. method_virtual_call_constructor_params_mixed(value_u8bit,
  3239. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3240. if object_u8bit <> RESULT_U8BIT then
  3241. failed := true;
  3242. if object_u16bit <> RESULT_U16BIT then
  3243. failed := true;
  3244. if object_s32bit <> RESULT_S32BIT then
  3245. failed := true;
  3246. if object_s64bit <> RESULT_S64BIT then
  3247. failed := true;
  3248. if object_bigstring <> RESULT_BIGSTRING then
  3249. failed := true;
  3250. destructor_params_done;
  3251. if failed then
  3252. fail
  3253. else
  3254. Writeln('Passed!');
  3255. (* static virtual call *)
  3256. clear_globals;
  3257. clear_values;
  3258. failed := false;
  3259. vmtclass:=theritedvmtclass.constructor_init;
  3260. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
  3261. method_virtual_call_static_params_mixed(RESULT_U8BIT,
  3262. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3263. if global_u8bit <> RESULT_U8BIT then
  3264. failed := true;
  3265. if global_u16bit <> RESULT_U16BIT then
  3266. failed := true;
  3267. if global_s32bit <> RESULT_S32BIT then
  3268. failed := true;
  3269. if global_s64bit <> RESULT_S64BIT then
  3270. failed := true;
  3271. if global_bigstring <> RESULT_BIGSTRING then
  3272. failed := true;
  3273. destructor_params_done;
  3274. if failed then
  3275. fail
  3276. else
  3277. Writeln('Passed!');
  3278. clear_globals;
  3279. clear_values;
  3280. failed := false;
  3281. vmtclass:=theritedvmtclass.constructor_init;
  3282. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
  3283. value_u8bit := RESULT_U8BIT;
  3284. value_u16bit := RESULT_U16BIT;
  3285. value_bigstring := RESULT_BIGSTRING;
  3286. value_s32bit := RESULT_S32BIT;
  3287. value_s64bit := RESULT_S64BIT;
  3288. method_virtual_call_static_params_mixed(value_u8bit,
  3289. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3290. if global_u8bit <> RESULT_U8BIT then
  3291. failed := true;
  3292. if global_u16bit <> RESULT_U16BIT then
  3293. failed := true;
  3294. if global_s32bit <> RESULT_S32BIT then
  3295. failed := true;
  3296. if global_s64bit <> RESULT_S64BIT then
  3297. failed := true;
  3298. if global_bigstring <> RESULT_BIGSTRING then
  3299. failed := true;
  3300. destructor_params_done;
  3301. if failed then
  3302. fail
  3303. else
  3304. Writeln('Passed!');
  3305. (* calls the inherited method *)
  3306. clear_globals;
  3307. clear_values;
  3308. failed := false;
  3309. { Calls the ancestor virtual method }
  3310. vmtclass:=theritedvmtclass.constructor_init;
  3311. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
  3312. method_virtual_call_inherited_params_mixed(RESULT_U8BIT,
  3313. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3314. if object_u8bit <> RESULT_U8BIT then
  3315. failed := true;
  3316. if object_u16bit <> RESULT_U16BIT then
  3317. failed := true;
  3318. if object_s32bit <> RESULT_S32BIT then
  3319. failed := true;
  3320. if object_s64bit <> RESULT_S64BIT then
  3321. failed := true;
  3322. if object_bigstring <> RESULT_BIGSTRING then
  3323. failed := true;
  3324. destructor_params_done;
  3325. if failed then
  3326. fail
  3327. else
  3328. Writeln('Passed!');
  3329. clear_globals;
  3330. clear_values;
  3331. failed := false;
  3332. vmtclass:=theritedvmtclass.constructor_init;
  3333. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
  3334. value_u8bit := RESULT_U8BIT;
  3335. value_u16bit := RESULT_U16BIT;
  3336. value_bigstring := RESULT_BIGSTRING;
  3337. value_s32bit := RESULT_S32BIT;
  3338. value_s64bit := RESULT_S64BIT;
  3339. method_virtual_call_inherited_params_mixed(value_u8bit,
  3340. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3341. if object_u8bit <> RESULT_U8BIT then
  3342. failed := true;
  3343. if object_u16bit <> RESULT_U16BIT then
  3344. failed := true;
  3345. if object_s32bit <> RESULT_S32BIT then
  3346. failed := true;
  3347. if object_s64bit <> RESULT_S64BIT then
  3348. failed := true;
  3349. if object_bigstring <> RESULT_BIGSTRING then
  3350. failed := true;
  3351. destructor_params_done;
  3352. if failed then
  3353. fail
  3354. else
  3355. Writeln('Passed!');
  3356. (* dynamic call testing *)
  3357. clear_globals;
  3358. clear_values;
  3359. failed := false;
  3360. vmtclass:=theritedvmtclass.constructor_init;
  3361. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/constructor call...');
  3362. method_dynamic_call_constructor_params_mixed(RESULT_U8BIT,
  3363. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3364. if object_u8bit <> RESULT_U8BIT then
  3365. failed := true;
  3366. if object_u16bit <> RESULT_U16BIT then
  3367. failed := true;
  3368. if object_s32bit <> RESULT_S32BIT then
  3369. failed := true;
  3370. if object_s64bit <> RESULT_S64BIT then
  3371. failed := true;
  3372. if object_bigstring <> RESULT_BIGSTRING then
  3373. failed := true;
  3374. destructor_params_done;
  3375. if failed then
  3376. fail
  3377. else
  3378. Writeln('Passed!');
  3379. clear_globals;
  3380. clear_values;
  3381. failed := false;
  3382. vmtclass:=theritedvmtclass.constructor_init;
  3383. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/constructor call...');
  3384. value_u8bit := RESULT_U8BIT;
  3385. value_u16bit := RESULT_U16BIT;
  3386. value_bigstring := RESULT_BIGSTRING;
  3387. value_s32bit := RESULT_S32BIT;
  3388. value_s64bit := RESULT_S64BIT;
  3389. method_dynamic_call_constructor_params_mixed(value_u8bit,
  3390. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3391. if object_u8bit <> RESULT_U8BIT then
  3392. failed := true;
  3393. if object_u16bit <> RESULT_U16BIT then
  3394. failed := true;
  3395. if object_s32bit <> RESULT_S32BIT then
  3396. failed := true;
  3397. if object_s64bit <> RESULT_S64BIT then
  3398. failed := true;
  3399. if object_bigstring <> RESULT_BIGSTRING then
  3400. failed := true;
  3401. destructor_params_done;
  3402. if failed then
  3403. fail
  3404. else
  3405. Writeln('Passed!');
  3406. (* static virtual call *)
  3407. clear_globals;
  3408. clear_values;
  3409. failed := false;
  3410. vmtclass:=theritedvmtclass.constructor_init;
  3411. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/static call...');
  3412. method_dynamic_call_static_params_mixed(RESULT_U8BIT,
  3413. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3414. if global_u8bit <> RESULT_U8BIT then
  3415. failed := true;
  3416. if global_u16bit <> RESULT_U16BIT then
  3417. failed := true;
  3418. if global_s32bit <> RESULT_S32BIT then
  3419. failed := true;
  3420. if global_s64bit <> RESULT_S64BIT then
  3421. failed := true;
  3422. if global_bigstring <> RESULT_BIGSTRING then
  3423. failed := true;
  3424. destructor_params_done;
  3425. if failed then
  3426. fail
  3427. else
  3428. Writeln('Passed!');
  3429. clear_globals;
  3430. clear_values;
  3431. failed := false;
  3432. vmtclass:=theritedvmtclass.constructor_init;
  3433. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/static call...');
  3434. value_u8bit := RESULT_U8BIT;
  3435. value_u16bit := RESULT_U16BIT;
  3436. value_bigstring := RESULT_BIGSTRING;
  3437. value_s32bit := RESULT_S32BIT;
  3438. value_s64bit := RESULT_S64BIT;
  3439. method_dynamic_call_static_params_mixed(value_u8bit,
  3440. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3441. if global_u8bit <> RESULT_U8BIT then
  3442. failed := true;
  3443. if global_u16bit <> RESULT_U16BIT then
  3444. failed := true;
  3445. if global_s32bit <> RESULT_S32BIT then
  3446. failed := true;
  3447. if global_s64bit <> RESULT_S64BIT then
  3448. failed := true;
  3449. if global_bigstring <> RESULT_BIGSTRING then
  3450. failed := true;
  3451. destructor_params_done;
  3452. if failed then
  3453. fail
  3454. else
  3455. Writeln('Passed!');
  3456. (* calls the inherited method *)
  3457. clear_globals;
  3458. clear_values;
  3459. failed := false;
  3460. { Calls the ancestor virtual method }
  3461. vmtclass:=theritedvmtclass.constructor_init;
  3462. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/inherited call...');
  3463. method_dynamic_call_inherited_params_mixed(RESULT_U8BIT,
  3464. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3465. if object_u8bit <> RESULT_U8BIT then
  3466. failed := true;
  3467. if object_u16bit <> RESULT_U16BIT then
  3468. failed := true;
  3469. if object_s32bit <> RESULT_S32BIT then
  3470. failed := true;
  3471. if object_s64bit <> RESULT_S64BIT then
  3472. failed := true;
  3473. if object_bigstring <> RESULT_BIGSTRING then
  3474. failed := true;
  3475. destructor_params_done;
  3476. if failed then
  3477. fail
  3478. else
  3479. Writeln('Passed!');
  3480. clear_globals;
  3481. clear_values;
  3482. failed := false;
  3483. vmtclass:=theritedvmtclass.constructor_init;
  3484. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/inherited call...');
  3485. value_u8bit := RESULT_U8BIT;
  3486. value_u16bit := RESULT_U16BIT;
  3487. value_bigstring := RESULT_BIGSTRING;
  3488. value_s32bit := RESULT_S32BIT;
  3489. value_s64bit := RESULT_S64BIT;
  3490. method_dynamic_call_inherited_params_mixed(value_u8bit,
  3491. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3492. if object_u8bit <> RESULT_U8BIT then
  3493. failed := true;
  3494. if object_u16bit <> RESULT_U16BIT then
  3495. failed := true;
  3496. if object_s32bit <> RESULT_S32BIT then
  3497. failed := true;
  3498. if object_s64bit <> RESULT_S64BIT then
  3499. failed := true;
  3500. if object_bigstring <> RESULT_BIGSTRING then
  3501. failed := true;
  3502. destructor_params_done;
  3503. if failed then
  3504. fail
  3505. else
  3506. Writeln('Passed!');
  3507. end; { end with }
  3508. end;
  3509. begin
  3510. WriteLN('*********************** CLASS TESTS ***********************');
  3511. testnovmtclass;
  3512. { WriteLN('************************ VMT OBJECT FAIL **********************');
  3513. testfailedclass;}
  3514. testvmtclass;
  3515. testheritedvmtclass;
  3516. WriteLN('*******************CLASS TESTS USING WITH ******************');
  3517. testwith;
  3518. end.