tcalcla1.pp 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026
  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. 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. 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. 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. 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. 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. 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. 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. vmtclass.destructor_params_done;
  1879. if failed then
  1880. fail
  1881. else
  1882. Writeln('Passed!');
  1883. (* constructor call inside a normal method *)
  1884. clear_globals;
  1885. clear_values;
  1886. failed := false;
  1887. vmtclass:=theritedvmtclass.constructor_init;
  1888. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
  1889. vmtclass.method_virtual_call_constructor_params_mixed(RESULT_U8BIT,
  1890. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1891. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1892. failed := true;
  1893. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1894. failed := true;
  1895. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1896. failed := true;
  1897. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1898. failed := true;
  1899. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1900. failed := true;
  1901. vmtclass.destructor_params_done;
  1902. if failed then
  1903. fail
  1904. else
  1905. Writeln('Passed!');
  1906. clear_globals;
  1907. clear_values;
  1908. failed := false;
  1909. vmtclass:=theritedvmtclass.constructor_init;
  1910. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
  1911. value_u8bit := RESULT_U8BIT;
  1912. value_u16bit := RESULT_U16BIT;
  1913. value_bigstring := RESULT_BIGSTRING;
  1914. value_s32bit := RESULT_S32BIT;
  1915. value_s64bit := RESULT_S64BIT;
  1916. vmtclass.method_virtual_call_constructor_params_mixed(value_u8bit,
  1917. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1918. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1919. failed := true;
  1920. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1921. failed := true;
  1922. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1923. failed := true;
  1924. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1925. failed := true;
  1926. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  1927. failed := true;
  1928. vmtclass.destructor_params_done;
  1929. if failed then
  1930. fail
  1931. else
  1932. Writeln('Passed!');
  1933. (* static virtual call *)
  1934. clear_globals;
  1935. clear_values;
  1936. failed := false;
  1937. vmtclass:=theritedvmtclass.constructor_init;
  1938. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
  1939. vmtclass.method_virtual_call_static_params_mixed(RESULT_U8BIT,
  1940. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1941. if global_u8bit <> RESULT_U8BIT then
  1942. failed := true;
  1943. if global_u16bit <> RESULT_U16BIT then
  1944. failed := true;
  1945. if global_s32bit <> RESULT_S32BIT then
  1946. failed := true;
  1947. if global_s64bit <> RESULT_S64BIT then
  1948. failed := true;
  1949. if global_bigstring <> RESULT_BIGSTRING then
  1950. failed := true;
  1951. vmtclass.destructor_params_done;
  1952. if failed then
  1953. fail
  1954. else
  1955. Writeln('Passed!');
  1956. clear_globals;
  1957. clear_values;
  1958. failed := false;
  1959. vmtclass:=theritedvmtclass.constructor_init;
  1960. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
  1961. value_u8bit := RESULT_U8BIT;
  1962. value_u16bit := RESULT_U16BIT;
  1963. value_bigstring := RESULT_BIGSTRING;
  1964. value_s32bit := RESULT_S32BIT;
  1965. value_s64bit := RESULT_S64BIT;
  1966. vmtclass.method_virtual_call_static_params_mixed(value_u8bit,
  1967. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  1968. if global_u8bit <> RESULT_U8BIT then
  1969. failed := true;
  1970. if global_u16bit <> RESULT_U16BIT then
  1971. failed := true;
  1972. if global_s32bit <> RESULT_S32BIT then
  1973. failed := true;
  1974. if global_s64bit <> RESULT_S64BIT then
  1975. failed := true;
  1976. if global_bigstring <> RESULT_BIGSTRING then
  1977. failed := true;
  1978. vmtclass.destructor_params_done;
  1979. if failed then
  1980. fail
  1981. else
  1982. Writeln('Passed!');
  1983. (* calls the inherited method *)
  1984. clear_globals;
  1985. clear_values;
  1986. failed := false;
  1987. { Calls the ancestor virtual method }
  1988. vmtclass:=theritedvmtclass.constructor_init;
  1989. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
  1990. vmtclass.method_virtual_call_inherited_params_mixed(RESULT_U8BIT,
  1991. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  1992. if vmtclass.object_u8bit <> RESULT_U8BIT then
  1993. failed := true;
  1994. if vmtclass.object_u16bit <> RESULT_U16BIT then
  1995. failed := true;
  1996. if vmtclass.object_s32bit <> RESULT_S32BIT then
  1997. failed := true;
  1998. if vmtclass.object_s64bit <> RESULT_S64BIT then
  1999. failed := true;
  2000. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2001. failed := true;
  2002. vmtclass.destructor_params_done;
  2003. if failed then
  2004. fail
  2005. else
  2006. Writeln('Passed!');
  2007. clear_globals;
  2008. clear_values;
  2009. failed := false;
  2010. vmtclass:=theritedvmtclass.constructor_init;
  2011. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
  2012. value_u8bit := RESULT_U8BIT;
  2013. value_u16bit := RESULT_U16BIT;
  2014. value_bigstring := RESULT_BIGSTRING;
  2015. value_s32bit := RESULT_S32BIT;
  2016. value_s64bit := RESULT_S64BIT;
  2017. vmtclass.method_virtual_call_inherited_params_mixed(value_u8bit,
  2018. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2019. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2020. failed := true;
  2021. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2022. failed := true;
  2023. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2024. failed := true;
  2025. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2026. failed := true;
  2027. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2028. failed := true;
  2029. vmtclass.destructor_params_done;
  2030. if failed then
  2031. fail
  2032. else
  2033. Writeln('Passed!');
  2034. (* dynamic call testing *)
  2035. clear_globals;
  2036. clear_values;
  2037. failed := false;
  2038. vmtclass:=theritedvmtclass.constructor_init;
  2039. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/constructor call...');
  2040. vmtclass.method_dynamic_call_constructor_params_mixed(RESULT_U8BIT,
  2041. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2042. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2043. failed := true;
  2044. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2045. failed := true;
  2046. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2047. failed := true;
  2048. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2049. failed := true;
  2050. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2051. failed := true;
  2052. vmtclass.destructor_params_done;
  2053. if failed then
  2054. fail
  2055. else
  2056. Writeln('Passed!');
  2057. clear_globals;
  2058. clear_values;
  2059. failed := false;
  2060. vmtclass:=theritedvmtclass.constructor_init;
  2061. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/constructor call...');
  2062. value_u8bit := RESULT_U8BIT;
  2063. value_u16bit := RESULT_U16BIT;
  2064. value_bigstring := RESULT_BIGSTRING;
  2065. value_s32bit := RESULT_S32BIT;
  2066. value_s64bit := RESULT_S64BIT;
  2067. vmtclass.method_dynamic_call_constructor_params_mixed(value_u8bit,
  2068. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2069. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2070. failed := true;
  2071. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2072. failed := true;
  2073. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2074. failed := true;
  2075. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2076. failed := true;
  2077. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2078. failed := true;
  2079. vmtclass.destructor_params_done;
  2080. if failed then
  2081. fail
  2082. else
  2083. Writeln('Passed!');
  2084. (* static virtual call *)
  2085. clear_globals;
  2086. clear_values;
  2087. failed := false;
  2088. vmtclass:=theritedvmtclass.constructor_init;
  2089. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/static call...');
  2090. vmtclass.method_dynamic_call_static_params_mixed(RESULT_U8BIT,
  2091. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2092. if global_u8bit <> RESULT_U8BIT then
  2093. failed := true;
  2094. if global_u16bit <> RESULT_U16BIT then
  2095. failed := true;
  2096. if global_s32bit <> RESULT_S32BIT then
  2097. failed := true;
  2098. if global_s64bit <> RESULT_S64BIT then
  2099. failed := true;
  2100. if global_bigstring <> RESULT_BIGSTRING then
  2101. failed := true;
  2102. vmtclass.destructor_params_done;
  2103. if failed then
  2104. fail
  2105. else
  2106. Writeln('Passed!');
  2107. clear_globals;
  2108. clear_values;
  2109. failed := false;
  2110. vmtclass:=theritedvmtclass.constructor_init;
  2111. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/static call...');
  2112. value_u8bit := RESULT_U8BIT;
  2113. value_u16bit := RESULT_U16BIT;
  2114. value_bigstring := RESULT_BIGSTRING;
  2115. value_s32bit := RESULT_S32BIT;
  2116. value_s64bit := RESULT_S64BIT;
  2117. vmtclass.method_dynamic_call_static_params_mixed(value_u8bit,
  2118. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2119. if global_u8bit <> RESULT_U8BIT then
  2120. failed := true;
  2121. if global_u16bit <> RESULT_U16BIT then
  2122. failed := true;
  2123. if global_s32bit <> RESULT_S32BIT then
  2124. failed := true;
  2125. if global_s64bit <> RESULT_S64BIT then
  2126. failed := true;
  2127. if global_bigstring <> RESULT_BIGSTRING then
  2128. failed := true;
  2129. vmtclass.destructor_params_done;
  2130. if failed then
  2131. fail
  2132. else
  2133. Writeln('Passed!');
  2134. (* calls the inherited method *)
  2135. clear_globals;
  2136. clear_values;
  2137. failed := false;
  2138. { Calls the ancestor virtual method }
  2139. vmtclass:=theritedvmtclass.constructor_init;
  2140. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/inherited call...');
  2141. vmtclass.method_dynamic_call_inherited_params_mixed(RESULT_U8BIT,
  2142. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2143. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2144. failed := true;
  2145. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2146. failed := true;
  2147. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2148. failed := true;
  2149. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2150. failed := true;
  2151. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2152. failed := true;
  2153. vmtclass.destructor_params_done;
  2154. if failed then
  2155. fail
  2156. else
  2157. Writeln('Passed!');
  2158. clear_globals;
  2159. clear_values;
  2160. failed := false;
  2161. vmtclass:=theritedvmtclass.constructor_init;
  2162. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/inherited call...');
  2163. value_u8bit := RESULT_U8BIT;
  2164. value_u16bit := RESULT_U16BIT;
  2165. value_bigstring := RESULT_BIGSTRING;
  2166. value_s32bit := RESULT_S32BIT;
  2167. value_s64bit := RESULT_S64BIT;
  2168. vmtclass.method_dynamic_call_inherited_params_mixed(value_u8bit,
  2169. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2170. if vmtclass.object_u8bit <> RESULT_U8BIT then
  2171. failed := true;
  2172. if vmtclass.object_u16bit <> RESULT_U16BIT then
  2173. failed := true;
  2174. if vmtclass.object_s32bit <> RESULT_S32BIT then
  2175. failed := true;
  2176. if vmtclass.object_s64bit <> RESULT_S64BIT then
  2177. failed := true;
  2178. if vmtclass.object_bigstring <> RESULT_BIGSTRING then
  2179. failed := true;
  2180. vmtclass.destructor_params_done;
  2181. if failed then
  2182. fail
  2183. else
  2184. Writeln('Passed!');
  2185. end;
  2186. procedure testwith;
  2187. var
  2188. vmtclass : theritedvmtclass;
  2189. failed : boolean;
  2190. begin
  2191. with vmtclass do
  2192. begin
  2193. {********************** CONSTRUCTOR TESTING ************************}
  2194. {********************** DESTRUCTOR TESTING ************************}
  2195. clear_globals;
  2196. clear_values;
  2197. failed := false;
  2198. Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
  2199. vmtclass := theritedvmtclass.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING,
  2200. RESULT_S32BIT, RESULT_S64BIT);
  2201. if object_u8bit <> RESULT_U8BIT then
  2202. failed := true;
  2203. if object_u16bit <> RESULT_U16BIT then
  2204. failed := true;
  2205. if object_s32bit <> RESULT_S32BIT then
  2206. failed := true;
  2207. if object_s64bit <> RESULT_S64BIT then
  2208. failed := true;
  2209. if object_bigstring <> RESULT_BIGSTRING then
  2210. failed := true;
  2211. destructor_params_done;
  2212. if failed then
  2213. fail
  2214. else
  2215. Writeln('Passed!');
  2216. clear_globals;
  2217. clear_values;
  2218. failed := false;
  2219. Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
  2220. value_u8bit := RESULT_U8BIT;
  2221. value_u16bit := RESULT_U16BIT;
  2222. value_bigstring := RESULT_BIGSTRING;
  2223. value_s32bit := RESULT_S32BIT;
  2224. value_s64bit := RESULT_S64BIT;
  2225. vmtclass := theritedvmtclass.constructor_params_mixed_call_inherited(value_u8bit,
  2226. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2227. if object_u8bit <> RESULT_U8BIT then
  2228. failed := true;
  2229. if object_u16bit <> RESULT_U16BIT then
  2230. failed := true;
  2231. if object_s32bit <> RESULT_S32BIT then
  2232. failed := true;
  2233. if object_s64bit <> RESULT_S64BIT then
  2234. failed := true;
  2235. if object_bigstring <> RESULT_BIGSTRING then
  2236. failed := true;
  2237. destructor_params_done;
  2238. if failed then
  2239. fail
  2240. else
  2241. Writeln('Passed!');
  2242. clear_globals;
  2243. clear_values;
  2244. failed := false;
  2245. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  2246. vmtclass := theritedvmtclass.constructor_params_mixed_call_virtual(RESULT_U8BIT,
  2247. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2248. if object_u8bit <> RESULT_U8BIT then
  2249. failed := true;
  2250. if object_u16bit <> RESULT_U16BIT then
  2251. failed := true;
  2252. if object_s32bit <> RESULT_S32BIT then
  2253. failed := true;
  2254. if object_s64bit <> RESULT_S64BIT then
  2255. failed := true;
  2256. if object_bigstring <> RESULT_BIGSTRING then
  2257. failed := true;
  2258. destructor_params_done;
  2259. if failed then
  2260. fail
  2261. else
  2262. Writeln('Passed!');
  2263. clear_globals;
  2264. clear_values;
  2265. failed := false;
  2266. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  2267. value_u8bit := RESULT_U8BIT;
  2268. value_u16bit := RESULT_U16BIT;
  2269. value_bigstring := RESULT_BIGSTRING;
  2270. value_s32bit := RESULT_S32BIT;
  2271. value_s64bit := RESULT_S64BIT;
  2272. vmtclass:=theritedvmtclass.constructor_params_mixed_call_virtual(value_u8bit,
  2273. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2274. if object_u8bit <> RESULT_U8BIT then
  2275. failed := true;
  2276. if object_u16bit <> RESULT_U16BIT then
  2277. failed := true;
  2278. if object_s32bit <> RESULT_S32BIT then
  2279. failed := true;
  2280. if object_s64bit <> RESULT_S64BIT then
  2281. failed := true;
  2282. if object_bigstring <> RESULT_BIGSTRING then
  2283. failed := true;
  2284. destructor_params_done;
  2285. if failed then
  2286. fail
  2287. else
  2288. Writeln('Passed!');
  2289. clear_globals;
  2290. clear_values;
  2291. failed := false;
  2292. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
  2293. vmtclass:=theritedvmtclass.constructor_params_mixed_call_overriden(RESULT_U8BIT,
  2294. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2295. if object_u8bit <> RESULT_U8BIT then
  2296. failed := true;
  2297. if object_u16bit <> RESULT_U16BIT then
  2298. failed := true;
  2299. if object_s32bit <> RESULT_S32BIT then
  2300. failed := true;
  2301. if object_s64bit <> RESULT_S64BIT then
  2302. failed := true;
  2303. if object_bigstring <> RESULT_BIGSTRING then
  2304. failed := true;
  2305. destructor_params_done;
  2306. if failed then
  2307. fail
  2308. else
  2309. Writeln('Passed!');
  2310. clear_globals;
  2311. clear_values;
  2312. failed := false;
  2313. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
  2314. value_u8bit := RESULT_U8BIT;
  2315. value_u16bit := RESULT_U16BIT;
  2316. value_bigstring := RESULT_BIGSTRING;
  2317. value_s32bit := RESULT_S32BIT;
  2318. value_s64bit := RESULT_S64BIT;
  2319. vmtclass:=theritedvmtclass.constructor_params_mixed_call_overriden(value_u8bit,
  2320. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2321. if object_u8bit <> RESULT_U8BIT then
  2322. failed := true;
  2323. if object_u16bit <> RESULT_U16BIT then
  2324. failed := true;
  2325. if object_s32bit <> RESULT_S32BIT then
  2326. failed := true;
  2327. if object_s64bit <> RESULT_S64BIT then
  2328. failed := true;
  2329. if object_bigstring <> RESULT_BIGSTRING then
  2330. failed := true;
  2331. destructor_params_done;
  2332. if failed then
  2333. fail
  2334. else
  2335. Writeln('Passed!');
  2336. clear_globals;
  2337. clear_values;
  2338. failed := false;
  2339. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
  2340. vmtclass:=theritedvmtclass.constructor_params_mixed_call_normal(RESULT_U8BIT,
  2341. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2342. if object_u8bit <> RESULT_U8BIT then
  2343. failed := true;
  2344. if object_u16bit <> RESULT_U16BIT then
  2345. failed := true;
  2346. if object_s32bit <> RESULT_S32BIT then
  2347. failed := true;
  2348. if object_s64bit <> RESULT_S64BIT then
  2349. failed := true;
  2350. if object_bigstring <> RESULT_BIGSTRING then
  2351. failed := true;
  2352. destructor_params_done;
  2353. if failed then
  2354. fail
  2355. else
  2356. Writeln('Passed!');
  2357. clear_globals;
  2358. clear_values;
  2359. failed := false;
  2360. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
  2361. value_u8bit := RESULT_U8BIT;
  2362. value_u16bit := RESULT_U16BIT;
  2363. value_bigstring := RESULT_BIGSTRING;
  2364. value_s32bit := RESULT_S32BIT;
  2365. value_s64bit := RESULT_S64BIT;
  2366. vmtclass:=theritedvmtclass.constructor_params_mixed_call_normal(value_u8bit,
  2367. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2368. if object_u8bit <> RESULT_U8BIT then
  2369. failed := true;
  2370. if object_u16bit <> RESULT_U16BIT then
  2371. failed := true;
  2372. if object_s32bit <> RESULT_S32BIT then
  2373. failed := true;
  2374. if object_s64bit <> RESULT_S64BIT then
  2375. failed := true;
  2376. if object_bigstring <> RESULT_BIGSTRING then
  2377. failed := true;
  2378. destructor_params_done;
  2379. if failed then
  2380. fail
  2381. else
  2382. Writeln('Passed!');
  2383. clear_globals;
  2384. clear_values;
  2385. failed := false;
  2386. Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
  2387. vmtclass:=theritedvmtclass.constructor_params_mixed_call_static(RESULT_U8BIT,
  2388. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2389. if global_u8bit <> RESULT_U8BIT then
  2390. failed := true;
  2391. if global_u16bit <> RESULT_U16BIT then
  2392. failed := true;
  2393. if global_s32bit <> RESULT_S32BIT then
  2394. failed := true;
  2395. if global_s64bit <> RESULT_S64BIT then
  2396. failed := true;
  2397. if global_bigstring <> RESULT_BIGSTRING then
  2398. failed := true;
  2399. destructor_params_done;
  2400. if failed then
  2401. fail
  2402. else
  2403. Writeln('Passed!');
  2404. clear_globals;
  2405. clear_values;
  2406. failed := false;
  2407. Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
  2408. value_u8bit := RESULT_U8BIT;
  2409. value_u16bit := RESULT_U16BIT;
  2410. value_bigstring := RESULT_BIGSTRING;
  2411. value_s32bit := RESULT_S32BIT;
  2412. value_s64bit := RESULT_S64BIT;
  2413. vmtclass:=theritedvmtclass.constructor_params_mixed_call_static(value_u8bit,
  2414. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2415. if global_u8bit <> RESULT_U8BIT then
  2416. failed := true;
  2417. if global_u16bit <> RESULT_U16BIT then
  2418. failed := true;
  2419. if global_s32bit <> RESULT_S32BIT then
  2420. failed := true;
  2421. if global_s64bit <> RESULT_S64BIT then
  2422. failed := true;
  2423. if global_bigstring <> RESULT_BIGSTRING then
  2424. failed := true;
  2425. destructor_params_done;
  2426. if failed then
  2427. fail
  2428. else
  2429. Writeln('Passed!');
  2430. {************************* METHOD TESTING **************************}
  2431. clear_globals;
  2432. clear_values;
  2433. failed := false;
  2434. vmtclass:=theritedvmtclass.constructor_init;
  2435. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  2436. method_virtual_params_mixed(RESULT_U8BIT,
  2437. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2438. if object_u8bit <> RESULT_U8BIT then
  2439. failed := true;
  2440. if object_u16bit <> RESULT_U16BIT then
  2441. failed := true;
  2442. if object_s32bit <> RESULT_S32BIT then
  2443. failed := true;
  2444. if object_s64bit <> RESULT_S64BIT then
  2445. failed := true;
  2446. if object_bigstring <> RESULT_BIGSTRING then
  2447. failed := true;
  2448. destructor_params_done;
  2449. if failed then
  2450. fail
  2451. else
  2452. Writeln('Passed!');
  2453. clear_globals;
  2454. clear_values;
  2455. failed := false;
  2456. vmtclass:=theritedvmtclass.constructor_init;
  2457. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  2458. value_u8bit := RESULT_U8BIT;
  2459. value_u16bit := RESULT_U16BIT;
  2460. value_bigstring := RESULT_BIGSTRING;
  2461. value_s32bit := RESULT_S32BIT;
  2462. value_s64bit := RESULT_S64BIT;
  2463. method_virtual_params_mixed(value_u8bit,
  2464. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2465. if object_u8bit <> RESULT_U8BIT then
  2466. failed := true;
  2467. if object_u16bit <> RESULT_U16BIT then
  2468. failed := true;
  2469. if object_s32bit <> RESULT_S32BIT then
  2470. failed := true;
  2471. if object_s64bit <> RESULT_S64BIT then
  2472. failed := true;
  2473. if object_bigstring <> RESULT_BIGSTRING then
  2474. failed := true;
  2475. destructor_params_done;
  2476. if failed then
  2477. fail
  2478. else
  2479. Writeln('Passed!');
  2480. clear_globals;
  2481. clear_values;
  2482. failed := false;
  2483. vmtclass:=theritedvmtclass.constructor_init;
  2484. Write('Testing mixed parameter (LOC_CONSTANT) dynamic method call...');
  2485. method_dynamic_params_mixed(RESULT_U8BIT,
  2486. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2487. if object_u8bit <> RESULT_U8BIT then
  2488. failed := true;
  2489. if object_u16bit <> RESULT_U16BIT then
  2490. failed := true;
  2491. if object_s32bit <> RESULT_S32BIT then
  2492. failed := true;
  2493. if object_s64bit <> RESULT_S64BIT then
  2494. failed := true;
  2495. if object_bigstring <> RESULT_BIGSTRING then
  2496. failed := true;
  2497. destructor_params_done;
  2498. if failed then
  2499. fail
  2500. else
  2501. Writeln('Passed!');
  2502. clear_globals;
  2503. clear_values;
  2504. failed := false;
  2505. vmtclass:=theritedvmtclass.constructor_init;
  2506. Write('Testing mixed parameter (LOC_CONSTANT) dynamic method call...');
  2507. method_dynamic_overriden_params_mixed(RESULT_U8BIT,
  2508. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2509. if object_u8bit <> RESULT_U8BIT then
  2510. failed := true;
  2511. if object_u16bit <> RESULT_U16BIT then
  2512. failed := true;
  2513. if object_s32bit <> RESULT_S32BIT then
  2514. failed := true;
  2515. if object_s64bit <> RESULT_S64BIT then
  2516. failed := true;
  2517. if object_bigstring <> RESULT_BIGSTRING then
  2518. failed := true;
  2519. destructor_params_done;
  2520. if failed then
  2521. fail
  2522. else
  2523. Writeln('Passed!');
  2524. clear_globals;
  2525. clear_values;
  2526. failed := false;
  2527. vmtclass:=theritedvmtclass.constructor_init;
  2528. Write('Testing mixed parameter (LOC_REFERENCE) dynamic method call...');
  2529. value_u8bit := RESULT_U8BIT;
  2530. value_u16bit := RESULT_U16BIT;
  2531. value_bigstring := RESULT_BIGSTRING;
  2532. value_s32bit := RESULT_S32BIT;
  2533. value_s64bit := RESULT_S64BIT;
  2534. method_dynamic_overriden_params_mixed(value_u8bit,
  2535. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2536. if object_u8bit <> RESULT_U8BIT then
  2537. failed := true;
  2538. if object_u16bit <> RESULT_U16BIT then
  2539. failed := true;
  2540. if object_s32bit <> RESULT_S32BIT then
  2541. failed := true;
  2542. if object_s64bit <> RESULT_S64BIT then
  2543. failed := true;
  2544. if object_bigstring <> RESULT_BIGSTRING then
  2545. failed := true;
  2546. destructor_params_done;
  2547. if failed then
  2548. fail
  2549. else
  2550. Writeln('Passed!');
  2551. clear_globals;
  2552. clear_values;
  2553. failed := false;
  2554. vmtclass:=theritedvmtclass.constructor_init;
  2555. Write('Testing mixed parameter (LOC_REFERENCE) dynamic method call...');
  2556. value_u8bit := RESULT_U8BIT;
  2557. value_u16bit := RESULT_U16BIT;
  2558. value_bigstring := RESULT_BIGSTRING;
  2559. value_s32bit := RESULT_S32BIT;
  2560. value_s64bit := RESULT_S64BIT;
  2561. method_dynamic_params_mixed(value_u8bit,
  2562. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2563. if object_u8bit <> RESULT_U8BIT then
  2564. failed := true;
  2565. if object_u16bit <> RESULT_U16BIT then
  2566. failed := true;
  2567. if object_s32bit <> RESULT_S32BIT then
  2568. failed := true;
  2569. if object_s64bit <> RESULT_S64BIT then
  2570. failed := true;
  2571. if object_bigstring <> RESULT_BIGSTRING then
  2572. failed := true;
  2573. destructor_params_done;
  2574. if failed then
  2575. fail
  2576. else
  2577. Writeln('Passed!');
  2578. clear_globals;
  2579. clear_values;
  2580. failed := false;
  2581. vmtclass:=theritedvmtclass.constructor_init;
  2582. Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
  2583. method_virtual_overriden_params_mixed(RESULT_U8BIT,
  2584. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2585. if object_u8bit <> RESULT_U8BIT then
  2586. failed := true;
  2587. if object_u16bit <> RESULT_U16BIT then
  2588. failed := true;
  2589. if object_s32bit <> RESULT_S32BIT then
  2590. failed := true;
  2591. if object_s64bit <> RESULT_S64BIT then
  2592. failed := true;
  2593. if object_bigstring <> RESULT_BIGSTRING then
  2594. failed := true;
  2595. destructor_params_done;
  2596. if failed then
  2597. fail
  2598. else
  2599. Writeln('Passed!');
  2600. clear_globals;
  2601. clear_values;
  2602. failed := false;
  2603. vmtclass:=theritedvmtclass.constructor_init;
  2604. Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
  2605. value_u8bit := RESULT_U8BIT;
  2606. value_u16bit := RESULT_U16BIT;
  2607. value_bigstring := RESULT_BIGSTRING;
  2608. value_s32bit := RESULT_S32BIT;
  2609. value_s64bit := RESULT_S64BIT;
  2610. method_virtual_overriden_params_mixed(value_u8bit,
  2611. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2612. if object_u8bit <> RESULT_U8BIT then
  2613. failed := true;
  2614. if object_u16bit <> RESULT_U16BIT then
  2615. failed := true;
  2616. if object_s32bit <> RESULT_S32BIT then
  2617. failed := true;
  2618. if object_s64bit <> RESULT_S64BIT then
  2619. failed := true;
  2620. if object_bigstring <> RESULT_BIGSTRING then
  2621. failed := true;
  2622. destructor_params_done;
  2623. if failed then
  2624. fail
  2625. else
  2626. Writeln('Passed!');
  2627. clear_globals;
  2628. clear_values;
  2629. failed := false;
  2630. vmtclass:=theritedvmtclass.constructor_init;
  2631. Write('Testing mixed parameter (LOC_CONSTANT) method call...');
  2632. method_normal_params_mixed(RESULT_U8BIT,
  2633. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2634. if object_u8bit <> RESULT_U8BIT then
  2635. failed := true;
  2636. if object_u16bit <> RESULT_U16BIT then
  2637. failed := true;
  2638. if object_s32bit <> RESULT_S32BIT then
  2639. failed := true;
  2640. if object_s64bit <> RESULT_S64BIT then
  2641. failed := true;
  2642. if object_bigstring <> RESULT_BIGSTRING then
  2643. failed := true;
  2644. destructor_params_done;
  2645. if failed then
  2646. fail
  2647. else
  2648. Writeln('Passed!');
  2649. clear_globals;
  2650. clear_values;
  2651. failed := false;
  2652. vmtclass:=theritedvmtclass.constructor_init;
  2653. Write('Testing mixed parameter (LOC_REFERENCE) method call...');
  2654. value_u8bit := RESULT_U8BIT;
  2655. value_u16bit := RESULT_U16BIT;
  2656. value_bigstring := RESULT_BIGSTRING;
  2657. value_s32bit := RESULT_S32BIT;
  2658. value_s64bit := RESULT_S64BIT;
  2659. method_normal_params_mixed(value_u8bit,
  2660. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2661. if object_u8bit <> RESULT_U8BIT then
  2662. failed := true;
  2663. if object_u16bit <> RESULT_U16BIT then
  2664. failed := true;
  2665. if object_s32bit <> RESULT_S32BIT then
  2666. failed := true;
  2667. if object_s64bit <> RESULT_S64BIT then
  2668. failed := true;
  2669. if object_bigstring <> RESULT_BIGSTRING then
  2670. failed := true;
  2671. destructor_params_done;
  2672. if failed then
  2673. fail
  2674. else
  2675. Writeln('Passed!');
  2676. clear_globals;
  2677. clear_values;
  2678. failed := false;
  2679. vmtclass:=theritedvmtclass.constructor_init;
  2680. Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
  2681. method_static_params_mixed(RESULT_U8BIT,
  2682. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2683. if global_u8bit <> RESULT_U8BIT then
  2684. failed := true;
  2685. if global_u16bit <> RESULT_U16BIT then
  2686. failed := true;
  2687. if global_s32bit <> RESULT_S32BIT then
  2688. failed := true;
  2689. if global_s64bit <> RESULT_S64BIT then
  2690. failed := true;
  2691. if global_bigstring <> RESULT_BIGSTRING then
  2692. failed := true;
  2693. destructor_params_done;
  2694. if failed then
  2695. fail
  2696. else
  2697. Writeln('Passed!');
  2698. clear_globals;
  2699. clear_values;
  2700. failed := false;
  2701. vmtclass:=theritedvmtclass.constructor_init;
  2702. Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
  2703. value_u8bit := RESULT_U8BIT;
  2704. value_u16bit := RESULT_U16BIT;
  2705. value_bigstring := RESULT_BIGSTRING;
  2706. value_s32bit := RESULT_S32BIT;
  2707. value_s64bit := RESULT_S64BIT;
  2708. method_static_params_mixed(value_u8bit,
  2709. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2710. if global_u8bit <> RESULT_U8BIT then
  2711. failed := true;
  2712. if global_u16bit <> RESULT_U16BIT then
  2713. failed := true;
  2714. if global_s32bit <> RESULT_S32BIT then
  2715. failed := true;
  2716. if global_s64bit <> RESULT_S64BIT then
  2717. failed := true;
  2718. if global_bigstring <> RESULT_BIGSTRING then
  2719. failed := true;
  2720. destructor_params_done;
  2721. if failed then
  2722. fail
  2723. else
  2724. Writeln('Passed!');
  2725. { ********************************************************************
  2726. This calls methods which in turn call other methods, or a constructor
  2727. or a destructor.
  2728. *********************************************************************
  2729. }
  2730. clear_globals;
  2731. clear_values;
  2732. failed := false;
  2733. { Calls the ancestor virtual method }
  2734. vmtclass:=theritedvmtclass.constructor_init;
  2735. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  2736. method_normal_call_virtual_params_mixed(RESULT_U8BIT,
  2737. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2738. if object_u8bit <> RESULT_U8BIT then
  2739. failed := true;
  2740. if object_u16bit <> RESULT_U16BIT then
  2741. failed := true;
  2742. if object_s32bit <> RESULT_S32BIT then
  2743. failed := true;
  2744. if object_s64bit <> RESULT_S64BIT then
  2745. failed := true;
  2746. if object_bigstring <> RESULT_BIGSTRING then
  2747. failed := true;
  2748. destructor_params_done;
  2749. if failed then
  2750. fail
  2751. else
  2752. Writeln('Passed!');
  2753. clear_globals;
  2754. clear_values;
  2755. failed := false;
  2756. vmtclass:=theritedvmtclass.constructor_init;
  2757. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  2758. value_u8bit := RESULT_U8BIT;
  2759. value_u16bit := RESULT_U16BIT;
  2760. value_bigstring := RESULT_BIGSTRING;
  2761. value_s32bit := RESULT_S32BIT;
  2762. value_s64bit := RESULT_S64BIT;
  2763. method_normal_call_virtual_params_mixed(value_u8bit,
  2764. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2765. if object_u8bit <> RESULT_U8BIT then
  2766. failed := true;
  2767. if object_u16bit <> RESULT_U16BIT then
  2768. failed := true;
  2769. if object_s32bit <> RESULT_S32BIT then
  2770. failed := true;
  2771. if object_s64bit <> RESULT_S64BIT then
  2772. failed := true;
  2773. if object_bigstring <> RESULT_BIGSTRING then
  2774. failed := true;
  2775. destructor_params_done;
  2776. if failed then
  2777. fail
  2778. else
  2779. Writeln('Passed!');
  2780. { The virtual method has been overriden by the object in this case }
  2781. vmtclass:=theritedvmtclass.constructor_init;
  2782. Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
  2783. method_normal_call_overriden_params_mixed(RESULT_U8BIT,
  2784. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2785. if object_u8bit <> RESULT_U8BIT then
  2786. failed := true;
  2787. if object_u16bit <> RESULT_U16BIT then
  2788. failed := true;
  2789. if object_s32bit <> RESULT_S32BIT then
  2790. failed := true;
  2791. if object_s64bit <> RESULT_S64BIT then
  2792. failed := true;
  2793. if object_bigstring <> RESULT_BIGSTRING then
  2794. failed := true;
  2795. destructor_params_done;
  2796. if failed then
  2797. fail
  2798. else
  2799. Writeln('Passed!');
  2800. clear_globals;
  2801. clear_values;
  2802. failed := false;
  2803. vmtclass:=theritedvmtclass.constructor_init;
  2804. Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
  2805. value_u8bit := RESULT_U8BIT;
  2806. value_u16bit := RESULT_U16BIT;
  2807. value_bigstring := RESULT_BIGSTRING;
  2808. value_s32bit := RESULT_S32BIT;
  2809. value_s64bit := RESULT_S64BIT;
  2810. method_normal_call_overriden_params_mixed(value_u8bit,
  2811. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2812. if object_u8bit <> RESULT_U8BIT then
  2813. failed := true;
  2814. if object_u16bit <> RESULT_U16BIT then
  2815. failed := true;
  2816. if object_s32bit <> RESULT_S32BIT then
  2817. failed := true;
  2818. if object_s64bit <> RESULT_S64BIT then
  2819. failed := true;
  2820. if object_bigstring <> RESULT_BIGSTRING then
  2821. failed := true;
  2822. destructor_params_done;
  2823. if failed then
  2824. fail
  2825. else
  2826. Writeln('Passed!');
  2827. clear_globals;
  2828. clear_values;
  2829. failed := false;
  2830. vmtclass:=theritedvmtclass.constructor_init;
  2831. Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
  2832. method_normal_call_normal_params_mixed(RESULT_U8BIT,
  2833. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2834. if object_u8bit <> RESULT_U8BIT then
  2835. failed := true;
  2836. if object_u16bit <> RESULT_U16BIT then
  2837. failed := true;
  2838. if object_s32bit <> RESULT_S32BIT then
  2839. failed := true;
  2840. if object_s64bit <> RESULT_S64BIT then
  2841. failed := true;
  2842. if object_bigstring <> RESULT_BIGSTRING then
  2843. failed := true;
  2844. destructor_params_done;
  2845. if failed then
  2846. fail
  2847. else
  2848. Writeln('Passed!');
  2849. clear_globals;
  2850. clear_values;
  2851. failed := false;
  2852. vmtclass:=theritedvmtclass.constructor_init;
  2853. Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
  2854. value_u8bit := RESULT_U8BIT;
  2855. value_u16bit := RESULT_U16BIT;
  2856. value_bigstring := RESULT_BIGSTRING;
  2857. value_s32bit := RESULT_S32BIT;
  2858. value_s64bit := RESULT_S64BIT;
  2859. method_normal_call_normal_params_mixed(value_u8bit,
  2860. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2861. if object_u8bit <> RESULT_U8BIT then
  2862. failed := true;
  2863. if object_u16bit <> RESULT_U16BIT then
  2864. failed := true;
  2865. if object_s32bit <> RESULT_S32BIT then
  2866. failed := true;
  2867. if object_s64bit <> RESULT_S64BIT then
  2868. failed := true;
  2869. if object_bigstring <> RESULT_BIGSTRING then
  2870. failed := true;
  2871. destructor_params_done;
  2872. if failed then
  2873. fail
  2874. else
  2875. Writeln('Passed!');
  2876. (* constructor call inside a normal method *)
  2877. clear_globals;
  2878. clear_values;
  2879. failed := false;
  2880. vmtclass:=theritedvmtclass.constructor_init;
  2881. Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
  2882. method_normal_call_constructor_params_mixed(RESULT_U8BIT,
  2883. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2884. if object_u8bit <> RESULT_U8BIT then
  2885. failed := true;
  2886. if object_u16bit <> RESULT_U16BIT then
  2887. failed := true;
  2888. if object_s32bit <> RESULT_S32BIT then
  2889. failed := true;
  2890. if object_s64bit <> RESULT_S64BIT then
  2891. failed := true;
  2892. if object_bigstring <> RESULT_BIGSTRING then
  2893. failed := true;
  2894. destructor_params_done;
  2895. if failed then
  2896. fail
  2897. else
  2898. Writeln('Passed!');
  2899. clear_globals;
  2900. clear_values;
  2901. failed := false;
  2902. vmtclass:=theritedvmtclass.constructor_init;
  2903. Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
  2904. value_u8bit := RESULT_U8BIT;
  2905. value_u16bit := RESULT_U16BIT;
  2906. value_bigstring := RESULT_BIGSTRING;
  2907. value_s32bit := RESULT_S32BIT;
  2908. value_s64bit := RESULT_S64BIT;
  2909. method_normal_call_constructor_params_mixed(value_u8bit,
  2910. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2911. if object_u8bit <> RESULT_U8BIT then
  2912. failed := true;
  2913. if object_u16bit <> RESULT_U16BIT then
  2914. failed := true;
  2915. if object_s32bit <> RESULT_S32BIT then
  2916. failed := true;
  2917. if object_s64bit <> RESULT_S64BIT then
  2918. failed := true;
  2919. if object_bigstring <> RESULT_BIGSTRING then
  2920. failed := true;
  2921. destructor_params_done;
  2922. if failed then
  2923. fail
  2924. else
  2925. Writeln('Passed!');
  2926. { static method call }
  2927. clear_globals;
  2928. clear_values;
  2929. failed := false;
  2930. vmtclass:=theritedvmtclass.constructor_init;
  2931. Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
  2932. method_normal_call_static_params_mixed(RESULT_U8BIT,
  2933. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2934. if global_u8bit <> RESULT_U8BIT then
  2935. failed := true;
  2936. if global_u16bit <> RESULT_U16BIT then
  2937. failed := true;
  2938. if global_s32bit <> RESULT_S32BIT then
  2939. failed := true;
  2940. if global_s64bit <> RESULT_S64BIT then
  2941. failed := true;
  2942. if global_bigstring <> RESULT_BIGSTRING then
  2943. failed := true;
  2944. destructor_params_done;
  2945. if failed then
  2946. fail
  2947. else
  2948. Writeln('Passed!');
  2949. clear_globals;
  2950. clear_values;
  2951. failed := false;
  2952. vmtclass:=theritedvmtclass.constructor_init;
  2953. Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
  2954. value_u8bit := RESULT_U8BIT;
  2955. value_u16bit := RESULT_U16BIT;
  2956. value_bigstring := RESULT_BIGSTRING;
  2957. value_s32bit := RESULT_S32BIT;
  2958. value_s64bit := RESULT_S64BIT;
  2959. method_normal_call_static_params_mixed(value_u8bit,
  2960. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  2961. if global_u8bit <> RESULT_U8BIT then
  2962. failed := true;
  2963. if global_u16bit <> RESULT_U16BIT then
  2964. failed := true;
  2965. if global_s32bit <> RESULT_S32BIT then
  2966. failed := true;
  2967. if global_s64bit <> RESULT_S64BIT then
  2968. failed := true;
  2969. if global_bigstring <> RESULT_BIGSTRING then
  2970. failed := true;
  2971. destructor_params_done;
  2972. if failed then
  2973. fail
  2974. else
  2975. Writeln('Passed!');
  2976. (* calls the inherited method *)
  2977. clear_globals;
  2978. clear_values;
  2979. failed := false;
  2980. { Calls the ancestor virtual method }
  2981. vmtclass:=theritedvmtclass.constructor_init;
  2982. Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
  2983. method_normal_call_inherited_params_mixed(RESULT_U8BIT,
  2984. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  2985. if object_u8bit <> RESULT_U8BIT then
  2986. failed := true;
  2987. if object_u16bit <> RESULT_U16BIT then
  2988. failed := true;
  2989. if object_s32bit <> RESULT_S32BIT then
  2990. failed := true;
  2991. if object_s64bit <> RESULT_S64BIT then
  2992. failed := true;
  2993. if object_bigstring <> RESULT_BIGSTRING then
  2994. failed := true;
  2995. destructor_params_done;
  2996. if failed then
  2997. fail
  2998. else
  2999. Writeln('Passed!');
  3000. clear_globals;
  3001. clear_values;
  3002. failed := false;
  3003. vmtclass:=theritedvmtclass.constructor_init;
  3004. Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
  3005. value_u8bit := RESULT_U8BIT;
  3006. value_u16bit := RESULT_U16BIT;
  3007. value_bigstring := RESULT_BIGSTRING;
  3008. value_s32bit := RESULT_S32BIT;
  3009. value_s64bit := RESULT_S64BIT;
  3010. method_normal_call_inherited_params_mixed(value_u8bit,
  3011. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3012. if object_u8bit <> RESULT_U8BIT then
  3013. failed := true;
  3014. if object_u16bit <> RESULT_U16BIT then
  3015. failed := true;
  3016. if object_s32bit <> RESULT_S32BIT then
  3017. failed := true;
  3018. if object_s64bit <> RESULT_S64BIT then
  3019. failed := true;
  3020. if object_bigstring <> RESULT_BIGSTRING then
  3021. failed := true;
  3022. destructor_params_done;
  3023. if failed then
  3024. fail
  3025. else
  3026. Writeln('Passed!');
  3027. { ********************************************************************
  3028. This calls virtual methods which in turn call other methods,
  3029. or a constructor or a destructor.
  3030. *********************************************************************
  3031. }
  3032. clear_globals;
  3033. clear_values;
  3034. failed := false;
  3035. { Calls the ancestor virtual method }
  3036. vmtclass:=theritedvmtclass.constructor_init;
  3037. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  3038. method_virtual_call_virtual_params_mixed(RESULT_U8BIT,
  3039. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3040. if object_u8bit <> RESULT_U8BIT then
  3041. failed := true;
  3042. if object_u16bit <> RESULT_U16BIT then
  3043. failed := true;
  3044. if object_s32bit <> RESULT_S32BIT then
  3045. failed := true;
  3046. if object_s64bit <> RESULT_S64BIT then
  3047. failed := true;
  3048. if object_bigstring <> RESULT_BIGSTRING then
  3049. failed := true;
  3050. destructor_params_done;
  3051. if failed then
  3052. fail
  3053. else
  3054. Writeln('Passed!');
  3055. clear_globals;
  3056. clear_values;
  3057. failed := false;
  3058. vmtclass:=theritedvmtclass.constructor_init;
  3059. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  3060. value_u8bit := RESULT_U8BIT;
  3061. value_u16bit := RESULT_U16BIT;
  3062. value_bigstring := RESULT_BIGSTRING;
  3063. value_s32bit := RESULT_S32BIT;
  3064. value_s64bit := RESULT_S64BIT;
  3065. method_virtual_call_virtual_params_mixed(value_u8bit,
  3066. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3067. if object_u8bit <> RESULT_U8BIT then
  3068. failed := true;
  3069. if object_u16bit <> RESULT_U16BIT then
  3070. failed := true;
  3071. if object_s32bit <> RESULT_S32BIT then
  3072. failed := true;
  3073. if object_s64bit <> RESULT_S64BIT then
  3074. failed := true;
  3075. if object_bigstring <> RESULT_BIGSTRING then
  3076. failed := true;
  3077. destructor_params_done;
  3078. if failed then
  3079. fail
  3080. else
  3081. Writeln('Passed!');
  3082. { The virtual method has been overriden by the object in this case }
  3083. vmtclass:=theritedvmtclass.constructor_init;
  3084. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
  3085. method_virtual_call_overriden_params_mixed(RESULT_U8BIT,
  3086. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3087. if object_u8bit <> RESULT_U8BIT then
  3088. failed := true;
  3089. if object_u16bit <> RESULT_U16BIT then
  3090. failed := true;
  3091. if object_s32bit <> RESULT_S32BIT then
  3092. failed := true;
  3093. if object_s64bit <> RESULT_S64BIT then
  3094. failed := true;
  3095. if object_bigstring <> RESULT_BIGSTRING then
  3096. failed := true;
  3097. destructor_params_done;
  3098. if failed then
  3099. fail
  3100. else
  3101. Writeln('Passed!');
  3102. clear_globals;
  3103. clear_values;
  3104. failed := false;
  3105. vmtclass:=theritedvmtclass.constructor_init;
  3106. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
  3107. value_u8bit := RESULT_U8BIT;
  3108. value_u16bit := RESULT_U16BIT;
  3109. value_bigstring := RESULT_BIGSTRING;
  3110. value_s32bit := RESULT_S32BIT;
  3111. value_s64bit := RESULT_S64BIT;
  3112. method_virtual_call_overriden_params_mixed(value_u8bit,
  3113. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3114. if object_u8bit <> RESULT_U8BIT then
  3115. failed := true;
  3116. if object_u16bit <> RESULT_U16BIT then
  3117. failed := true;
  3118. if object_s32bit <> RESULT_S32BIT then
  3119. failed := true;
  3120. if object_s64bit <> RESULT_S64BIT then
  3121. failed := true;
  3122. if object_bigstring <> RESULT_BIGSTRING then
  3123. failed := true;
  3124. destructor_params_done;
  3125. if failed then
  3126. fail
  3127. else
  3128. Writeln('Passed!');
  3129. clear_globals;
  3130. clear_values;
  3131. failed := false;
  3132. vmtclass:=theritedvmtclass.constructor_init;
  3133. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
  3134. method_virtual_call_normal_params_mixed(RESULT_U8BIT,
  3135. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3136. if object_u8bit <> RESULT_U8BIT then
  3137. failed := true;
  3138. if object_u16bit <> RESULT_U16BIT then
  3139. failed := true;
  3140. if object_s32bit <> RESULT_S32BIT then
  3141. failed := true;
  3142. if object_s64bit <> RESULT_S64BIT then
  3143. failed := true;
  3144. if object_bigstring <> RESULT_BIGSTRING then
  3145. failed := true;
  3146. destructor_params_done;
  3147. if failed then
  3148. fail
  3149. else
  3150. Writeln('Passed!');
  3151. clear_globals;
  3152. clear_values;
  3153. failed := false;
  3154. vmtclass:=theritedvmtclass.constructor_init;
  3155. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
  3156. value_u8bit := RESULT_U8BIT;
  3157. value_u16bit := RESULT_U16BIT;
  3158. value_bigstring := RESULT_BIGSTRING;
  3159. value_s32bit := RESULT_S32BIT;
  3160. value_s64bit := RESULT_S64BIT;
  3161. method_virtual_call_normal_params_mixed(value_u8bit,
  3162. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3163. if object_u8bit <> RESULT_U8BIT then
  3164. failed := true;
  3165. if object_u16bit <> RESULT_U16BIT then
  3166. failed := true;
  3167. if object_s32bit <> RESULT_S32BIT then
  3168. failed := true;
  3169. if object_s64bit <> RESULT_S64BIT then
  3170. failed := true;
  3171. if object_bigstring <> RESULT_BIGSTRING then
  3172. failed := true;
  3173. destructor_params_done;
  3174. if failed then
  3175. fail
  3176. else
  3177. Writeln('Passed!');
  3178. (* destructor call inside a normal method *)
  3179. clear_globals;
  3180. clear_values;
  3181. failed := false;
  3182. vmtclass:=theritedvmtclass.constructor_params_mixed(RESULT_U8BIT,
  3183. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3184. Write('Testing virtual call w/destructor call...');
  3185. method_virtual_call_destructor;
  3186. if global_u8bit <> RESULT_U8BIT then
  3187. failed := true;
  3188. if global_u16bit <> RESULT_U16BIT then
  3189. failed := true;
  3190. if global_s32bit <> RESULT_S32BIT then
  3191. failed := true;
  3192. if global_s64bit <> RESULT_S64BIT then
  3193. failed := true;
  3194. if global_bigstring <> RESULT_BIGSTRING then
  3195. failed := true;
  3196. destructor_params_done;
  3197. if failed then
  3198. fail
  3199. else
  3200. Writeln('Passed!');
  3201. (* constructor call inside a normal method *)
  3202. clear_globals;
  3203. clear_values;
  3204. failed := false;
  3205. vmtclass:=theritedvmtclass.constructor_init;
  3206. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
  3207. method_virtual_call_constructor_params_mixed(RESULT_U8BIT,
  3208. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3209. if object_u8bit <> RESULT_U8BIT then
  3210. failed := true;
  3211. if object_u16bit <> RESULT_U16BIT then
  3212. failed := true;
  3213. if object_s32bit <> RESULT_S32BIT then
  3214. failed := true;
  3215. if object_s64bit <> RESULT_S64BIT then
  3216. failed := true;
  3217. if object_bigstring <> RESULT_BIGSTRING then
  3218. failed := true;
  3219. destructor_params_done;
  3220. if failed then
  3221. fail
  3222. else
  3223. Writeln('Passed!');
  3224. clear_globals;
  3225. clear_values;
  3226. failed := false;
  3227. vmtclass:=theritedvmtclass.constructor_init;
  3228. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
  3229. value_u8bit := RESULT_U8BIT;
  3230. value_u16bit := RESULT_U16BIT;
  3231. value_bigstring := RESULT_BIGSTRING;
  3232. value_s32bit := RESULT_S32BIT;
  3233. value_s64bit := RESULT_S64BIT;
  3234. method_virtual_call_constructor_params_mixed(value_u8bit,
  3235. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3236. if object_u8bit <> RESULT_U8BIT then
  3237. failed := true;
  3238. if object_u16bit <> RESULT_U16BIT then
  3239. failed := true;
  3240. if object_s32bit <> RESULT_S32BIT then
  3241. failed := true;
  3242. if object_s64bit <> RESULT_S64BIT then
  3243. failed := true;
  3244. if object_bigstring <> RESULT_BIGSTRING then
  3245. failed := true;
  3246. destructor_params_done;
  3247. if failed then
  3248. fail
  3249. else
  3250. Writeln('Passed!');
  3251. (* static virtual call *)
  3252. clear_globals;
  3253. clear_values;
  3254. failed := false;
  3255. vmtclass:=theritedvmtclass.constructor_init;
  3256. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
  3257. method_virtual_call_static_params_mixed(RESULT_U8BIT,
  3258. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3259. if global_u8bit <> RESULT_U8BIT then
  3260. failed := true;
  3261. if global_u16bit <> RESULT_U16BIT then
  3262. failed := true;
  3263. if global_s32bit <> RESULT_S32BIT then
  3264. failed := true;
  3265. if global_s64bit <> RESULT_S64BIT then
  3266. failed := true;
  3267. if global_bigstring <> RESULT_BIGSTRING then
  3268. failed := true;
  3269. destructor_params_done;
  3270. if failed then
  3271. fail
  3272. else
  3273. Writeln('Passed!');
  3274. clear_globals;
  3275. clear_values;
  3276. failed := false;
  3277. vmtclass:=theritedvmtclass.constructor_init;
  3278. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
  3279. value_u8bit := RESULT_U8BIT;
  3280. value_u16bit := RESULT_U16BIT;
  3281. value_bigstring := RESULT_BIGSTRING;
  3282. value_s32bit := RESULT_S32BIT;
  3283. value_s64bit := RESULT_S64BIT;
  3284. method_virtual_call_static_params_mixed(value_u8bit,
  3285. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3286. if global_u8bit <> RESULT_U8BIT then
  3287. failed := true;
  3288. if global_u16bit <> RESULT_U16BIT then
  3289. failed := true;
  3290. if global_s32bit <> RESULT_S32BIT then
  3291. failed := true;
  3292. if global_s64bit <> RESULT_S64BIT then
  3293. failed := true;
  3294. if global_bigstring <> RESULT_BIGSTRING then
  3295. failed := true;
  3296. destructor_params_done;
  3297. if failed then
  3298. fail
  3299. else
  3300. Writeln('Passed!');
  3301. (* calls the inherited method *)
  3302. clear_globals;
  3303. clear_values;
  3304. failed := false;
  3305. { Calls the ancestor virtual method }
  3306. vmtclass:=theritedvmtclass.constructor_init;
  3307. Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
  3308. method_virtual_call_inherited_params_mixed(RESULT_U8BIT,
  3309. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3310. if object_u8bit <> RESULT_U8BIT then
  3311. failed := true;
  3312. if object_u16bit <> RESULT_U16BIT then
  3313. failed := true;
  3314. if object_s32bit <> RESULT_S32BIT then
  3315. failed := true;
  3316. if object_s64bit <> RESULT_S64BIT then
  3317. failed := true;
  3318. if object_bigstring <> RESULT_BIGSTRING then
  3319. failed := true;
  3320. destructor_params_done;
  3321. if failed then
  3322. fail
  3323. else
  3324. Writeln('Passed!');
  3325. clear_globals;
  3326. clear_values;
  3327. failed := false;
  3328. vmtclass:=theritedvmtclass.constructor_init;
  3329. Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
  3330. value_u8bit := RESULT_U8BIT;
  3331. value_u16bit := RESULT_U16BIT;
  3332. value_bigstring := RESULT_BIGSTRING;
  3333. value_s32bit := RESULT_S32BIT;
  3334. value_s64bit := RESULT_S64BIT;
  3335. method_virtual_call_inherited_params_mixed(value_u8bit,
  3336. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3337. if object_u8bit <> RESULT_U8BIT then
  3338. failed := true;
  3339. if object_u16bit <> RESULT_U16BIT then
  3340. failed := true;
  3341. if object_s32bit <> RESULT_S32BIT then
  3342. failed := true;
  3343. if object_s64bit <> RESULT_S64BIT then
  3344. failed := true;
  3345. if object_bigstring <> RESULT_BIGSTRING then
  3346. failed := true;
  3347. destructor_params_done;
  3348. if failed then
  3349. fail
  3350. else
  3351. Writeln('Passed!');
  3352. (* dynamic call testing *)
  3353. clear_globals;
  3354. clear_values;
  3355. failed := false;
  3356. vmtclass:=theritedvmtclass.constructor_init;
  3357. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/constructor call...');
  3358. method_dynamic_call_constructor_params_mixed(RESULT_U8BIT,
  3359. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3360. if object_u8bit <> RESULT_U8BIT then
  3361. failed := true;
  3362. if object_u16bit <> RESULT_U16BIT then
  3363. failed := true;
  3364. if object_s32bit <> RESULT_S32BIT then
  3365. failed := true;
  3366. if object_s64bit <> RESULT_S64BIT then
  3367. failed := true;
  3368. if object_bigstring <> RESULT_BIGSTRING then
  3369. failed := true;
  3370. destructor_params_done;
  3371. if failed then
  3372. fail
  3373. else
  3374. Writeln('Passed!');
  3375. clear_globals;
  3376. clear_values;
  3377. failed := false;
  3378. vmtclass:=theritedvmtclass.constructor_init;
  3379. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/constructor call...');
  3380. value_u8bit := RESULT_U8BIT;
  3381. value_u16bit := RESULT_U16BIT;
  3382. value_bigstring := RESULT_BIGSTRING;
  3383. value_s32bit := RESULT_S32BIT;
  3384. value_s64bit := RESULT_S64BIT;
  3385. method_dynamic_call_constructor_params_mixed(value_u8bit,
  3386. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3387. if object_u8bit <> RESULT_U8BIT then
  3388. failed := true;
  3389. if object_u16bit <> RESULT_U16BIT then
  3390. failed := true;
  3391. if object_s32bit <> RESULT_S32BIT then
  3392. failed := true;
  3393. if object_s64bit <> RESULT_S64BIT then
  3394. failed := true;
  3395. if object_bigstring <> RESULT_BIGSTRING then
  3396. failed := true;
  3397. destructor_params_done;
  3398. if failed then
  3399. fail
  3400. else
  3401. Writeln('Passed!');
  3402. (* static virtual call *)
  3403. clear_globals;
  3404. clear_values;
  3405. failed := false;
  3406. vmtclass:=theritedvmtclass.constructor_init;
  3407. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/static call...');
  3408. method_dynamic_call_static_params_mixed(RESULT_U8BIT,
  3409. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3410. if global_u8bit <> RESULT_U8BIT then
  3411. failed := true;
  3412. if global_u16bit <> RESULT_U16BIT then
  3413. failed := true;
  3414. if global_s32bit <> RESULT_S32BIT then
  3415. failed := true;
  3416. if global_s64bit <> RESULT_S64BIT then
  3417. failed := true;
  3418. if global_bigstring <> RESULT_BIGSTRING then
  3419. failed := true;
  3420. destructor_params_done;
  3421. if failed then
  3422. fail
  3423. else
  3424. Writeln('Passed!');
  3425. clear_globals;
  3426. clear_values;
  3427. failed := false;
  3428. vmtclass:=theritedvmtclass.constructor_init;
  3429. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/static call...');
  3430. value_u8bit := RESULT_U8BIT;
  3431. value_u16bit := RESULT_U16BIT;
  3432. value_bigstring := RESULT_BIGSTRING;
  3433. value_s32bit := RESULT_S32BIT;
  3434. value_s64bit := RESULT_S64BIT;
  3435. method_dynamic_call_static_params_mixed(value_u8bit,
  3436. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3437. if global_u8bit <> RESULT_U8BIT then
  3438. failed := true;
  3439. if global_u16bit <> RESULT_U16BIT then
  3440. failed := true;
  3441. if global_s32bit <> RESULT_S32BIT then
  3442. failed := true;
  3443. if global_s64bit <> RESULT_S64BIT then
  3444. failed := true;
  3445. if global_bigstring <> RESULT_BIGSTRING then
  3446. failed := true;
  3447. destructor_params_done;
  3448. if failed then
  3449. fail
  3450. else
  3451. Writeln('Passed!');
  3452. (* calls the inherited method *)
  3453. clear_globals;
  3454. clear_values;
  3455. failed := false;
  3456. { Calls the ancestor virtual method }
  3457. vmtclass:=theritedvmtclass.constructor_init;
  3458. Write('Testing mixed parameter (LOC_CONSTANT) dynamic call w/inherited call...');
  3459. method_dynamic_call_inherited_params_mixed(RESULT_U8BIT,
  3460. RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
  3461. if object_u8bit <> RESULT_U8BIT then
  3462. failed := true;
  3463. if object_u16bit <> RESULT_U16BIT then
  3464. failed := true;
  3465. if object_s32bit <> RESULT_S32BIT then
  3466. failed := true;
  3467. if object_s64bit <> RESULT_S64BIT then
  3468. failed := true;
  3469. if object_bigstring <> RESULT_BIGSTRING then
  3470. failed := true;
  3471. destructor_params_done;
  3472. if failed then
  3473. fail
  3474. else
  3475. Writeln('Passed!');
  3476. clear_globals;
  3477. clear_values;
  3478. failed := false;
  3479. vmtclass:=theritedvmtclass.constructor_init;
  3480. Write('Testing mixed parameter (LOC_REFERENCE) dynamic call w/inherited call...');
  3481. value_u8bit := RESULT_U8BIT;
  3482. value_u16bit := RESULT_U16BIT;
  3483. value_bigstring := RESULT_BIGSTRING;
  3484. value_s32bit := RESULT_S32BIT;
  3485. value_s64bit := RESULT_S64BIT;
  3486. method_dynamic_call_inherited_params_mixed(value_u8bit,
  3487. value_u16bit, value_bigstring, value_s32bit, value_s64bit);
  3488. if object_u8bit <> RESULT_U8BIT then
  3489. failed := true;
  3490. if object_u16bit <> RESULT_U16BIT then
  3491. failed := true;
  3492. if object_s32bit <> RESULT_S32BIT then
  3493. failed := true;
  3494. if object_s64bit <> RESULT_S64BIT then
  3495. failed := true;
  3496. if object_bigstring <> RESULT_BIGSTRING then
  3497. failed := true;
  3498. destructor_params_done;
  3499. if failed then
  3500. fail
  3501. else
  3502. Writeln('Passed!');
  3503. end; { end with }
  3504. end;
  3505. begin
  3506. WriteLN('*********************** CLASS TESTS ***********************');
  3507. testnovmtclass;
  3508. { WriteLN('************************ VMT OBJECT FAIL **********************');
  3509. testfailedclass;}
  3510. testvmtclass;
  3511. testheritedvmtclass;
  3512. WriteLN('*******************CLASS TESTS USING WITH ******************');
  3513. testwith;
  3514. end.
  3515. {
  3516. $Log$
  3517. Revision 1.4 2003-05-15 20:38:11 peter
  3518. * remove po_containsself tests
  3519. Revision 1.3 2003/04/22 10:24:29 florian
  3520. * fixed defines for powerpc
  3521. Revision 1.2 2002/09/07 15:40:49 peter
  3522. * old logs removed and tabs fixed
  3523. Revision 1.1 2002/05/05 19:15:52 carl
  3524. + complete class method call testing (secondcalln())
  3525. }