tcalcla1.pp 121 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010
  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.