tcalobj1.pp 105 KB

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