tcalcla1.pp 130 KB

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