tformalpara.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. unit tformalpara;
  2. {$mode delphi}
  3. {$modeswitch unicodestrings}
  4. interface
  5. procedure main(args: array of string);
  6. implementation
  7. uses
  8. jdk15;
  9. type
  10. tc = class
  11. end;
  12. procedure freeandnil(var obj);
  13. begin
  14. obj:=nil;
  15. end;
  16. procedure test;
  17. var
  18. c: tc;
  19. begin
  20. c:=tc.create;
  21. freeandnil(c);
  22. if assigned(c) then
  23. raise jlexception.create('help');
  24. end;
  25. type
  26. tformalkind = (fboolean,fbyte,fsmallint,fcardinal,fint64,fchar,fwidechar,fsingle,fdouble,fsetint,fsetenum,frec,fshortstring,funicodestring,farrbyte,farrset);
  27. tsetint = set of 30..40;
  28. tsetenum = set of tformalkind;
  29. tarrbyte = array[4..6] of byte;
  30. tarrset = array[1..2] of tsetint;
  31. trec = record
  32. a: longint;
  33. b: array[3..4] of ansistring;
  34. end;
  35. const
  36. cbooleanin: boolean = true;
  37. cbytein: byte = 35;
  38. csmallintin: smallint = 1234;
  39. ccardinalin: cardinal = $1234567;
  40. cint64in: int64 = $deadcafebabe;
  41. ccharin: ansichar = 'S';
  42. cwidecharin: widechar = 'U';
  43. csinglein: single = 1234.5;
  44. cdoublein: double = 1239643.75;
  45. csetintin: tsetint = [36..39];
  46. csetenumin: tsetenum = [fsmallint,fint64,funicodestring];
  47. crecin: trec = (a:98765; b:('abc','def'));
  48. cshortstringin: shortstring = 'greaT';
  49. cunicodestringin: unicodestring = 'a bit longer!';
  50. carrbytein: tarrbyte = (4,2,5);
  51. carrsetin: tarrset = ([31,33,37],[]);
  52. cbooleanout: boolean = false;
  53. cbyteout: byte = 128;
  54. csmallintout: smallint = 4321;
  55. ccardinalout: cardinal = $7654321;
  56. cint64out: int64 = $B4B3154713;
  57. ccharout: ansichar = 's';
  58. cwidecharout: widechar = 'u';
  59. csingleout: single = 4321.5;
  60. cdoubleout: double = 9876543.75;
  61. csetintout: tsetint = [31..36];
  62. csetenumout: tsetenum = [fbyte];
  63. crecout: trec = (a:4365246; b:('cbax','iiiiii'));
  64. cshortstringout: shortstring = 'tiny';
  65. cunicodestringout: unicodestring = 'yet another bit longer!';
  66. carrbyteout: tarrbyte = (6,6,6);
  67. carrsetout: tarrset = ([30,31],[33..38]);
  68. procedure testformalvar(var x; typ: tformalkind);
  69. var
  70. i: longint;
  71. begin
  72. case typ of
  73. fboolean:
  74. begin
  75. if cbooleanin<>boolean(x) then
  76. raise jlexception.create('boolean in');
  77. x:=cbooleanout;
  78. end;
  79. fbyte:
  80. begin
  81. if cbytein<>byte(x) then
  82. raise jlexception.create('byte in');
  83. x:=cbyteout;
  84. end;
  85. fsmallint:
  86. begin
  87. if csmallintin<>smallint(x) then
  88. raise jlexception.create('smallint in');
  89. x:=csmallintout;
  90. end;
  91. fcardinal:
  92. begin
  93. if ccardinalin<>cardinal(x) then
  94. raise jlexception.create('cardinal in');
  95. x:=ccardinalout;
  96. end;
  97. fint64:
  98. begin
  99. if cint64in<>int64(x) then
  100. raise jlexception.create('int64 in');
  101. x:=cint64out;
  102. end;
  103. fchar:
  104. begin
  105. if ccharin<>ansichar(x) then
  106. raise jlexception.create('char in');
  107. x:=ccharout;
  108. end;
  109. fwidechar:
  110. begin
  111. if cwidecharin<>widechar(x) then
  112. raise jlexception.create('widechar in');
  113. x:=cwidecharout;
  114. end;
  115. fsingle:
  116. begin
  117. if csinglein<>single(x) then
  118. raise jlexception.create('single in');
  119. x:=csingleout;
  120. end;
  121. fdouble:
  122. begin
  123. if cdoublein<>double(x) then
  124. raise jlexception.create('double in');
  125. x:=cdoubleout;
  126. end;
  127. fsetint:
  128. begin
  129. if csetintin<>tsetint(x) then
  130. raise jlexception.create('setint in');
  131. x:=csetintout;
  132. end;
  133. fsetenum:
  134. begin
  135. if csetenumin<>tsetenum(x) then
  136. raise jlexception.create('setenum in');
  137. x:=csetenumout;
  138. end;
  139. frec:
  140. begin
  141. if crecin.a<>trec(x).a then
  142. raise jlexception.create('rec.a in');
  143. if crecin.b[3]<>trec(x).b[3] then
  144. raise jlexception.create('rec.b[3] in');
  145. if crecin.b[4]<>trec(x).b[4] then
  146. raise jlexception.create('rec.b[4] in');
  147. x:=crecout;
  148. end;
  149. fshortstring:
  150. begin
  151. if cshortstringin<>shortstring(x) then
  152. raise jlexception.create('shortstring in');
  153. x:=cshortstringout;
  154. end;
  155. funicodestring:
  156. begin
  157. if cunicodestringin<>unicodestring(x) then
  158. raise jlexception.create('unicodestring in');
  159. x:=cunicodestringout;
  160. end;
  161. farrbyte:
  162. begin
  163. for i:=low(carrbytein) to high(carrbytein) do
  164. if carrbytein[i]<>tarrbyte(x)[i] then
  165. raise jlexception.create('arrbyte in');
  166. x:=carrbyteout;
  167. end;
  168. farrset:
  169. begin
  170. for i:=low(carrsetin) to high(carrsetin) do
  171. if carrsetin[i]<>tarrset(x)[i] then
  172. raise jlexception.create('arrset in');
  173. x:=carrsetout;
  174. end;
  175. end;
  176. end;
  177. procedure testformalout(out x; typ: tformalkind);
  178. var
  179. i: longint;
  180. begin
  181. case typ of
  182. fboolean:
  183. begin
  184. x:=cbooleanout;
  185. end;
  186. fbyte:
  187. begin
  188. x:=cbyteout;
  189. end;
  190. fsmallint:
  191. begin
  192. x:=csmallintout;
  193. end;
  194. fcardinal:
  195. begin
  196. x:=ccardinalout;
  197. end;
  198. fint64:
  199. begin
  200. x:=cint64out;
  201. end;
  202. fchar:
  203. begin
  204. x:=ccharout;
  205. end;
  206. fwidechar:
  207. begin
  208. x:=cwidecharout;
  209. end;
  210. fsingle:
  211. begin
  212. x:=csingleout;
  213. end;
  214. fdouble:
  215. begin
  216. x:=cdoubleout;
  217. end;
  218. fsetint:
  219. begin
  220. x:=csetintout;
  221. end;
  222. fsetenum:
  223. begin
  224. x:=csetenumout;
  225. end;
  226. frec:
  227. begin
  228. { fpc only decreases the reference, it doesn't finalize/init with empty/nil
  229. if ''<>trec(x).b[3] then
  230. raise jlexception.create('out rec.b[3] in');
  231. if ''<>trec(x).b[4] then
  232. raise jlexception.create('out rec.b[4] in');
  233. }
  234. x:=crecout;
  235. end;
  236. fshortstring:
  237. begin
  238. x:=cshortstringout;
  239. end;
  240. funicodestring:
  241. begin
  242. { fpc only decreases the reference, it doesn't finalize/init with if ''<>unicodestring(x) then
  243. raise jlexception.create('out unicodestring in');
  244. }
  245. x:=cunicodestringout;
  246. end;
  247. farrbyte:
  248. begin
  249. x:=carrbyteout;
  250. end;
  251. farrset:
  252. begin
  253. x:=carrsetout;
  254. end;
  255. end;
  256. end;
  257. procedure testformalconst(const x; typ: tformalkind);
  258. var
  259. i: longint;
  260. begin
  261. case typ of
  262. fboolean:
  263. begin
  264. if cbooleanin<>boolean(x) then
  265. raise jlexception.create('const boolean in');
  266. end;
  267. fbyte:
  268. begin
  269. if cbytein<>byte(x) then
  270. raise jlexception.create('const byte in');
  271. end;
  272. fsmallint:
  273. begin
  274. if csmallintin<>smallint(x) then
  275. raise jlexception.create('const smallint in');
  276. end;
  277. fcardinal:
  278. begin
  279. if ccardinalin<>cardinal(x) then
  280. raise jlexception.create('const cardinal in');
  281. end;
  282. fint64:
  283. begin
  284. if cint64in<>int64(x) then
  285. raise jlexception.create('const int64 in');
  286. end;
  287. fchar:
  288. begin
  289. if ccharin<>ansichar(x) then
  290. raise jlexception.create('const char in');
  291. end;
  292. fwidechar:
  293. begin
  294. if cwidecharin<>widechar(x) then
  295. raise jlexception.create('const widechar in');
  296. end;
  297. fsingle:
  298. begin
  299. if csinglein<>single(x) then
  300. raise jlexception.create('const single in');
  301. end;
  302. fdouble:
  303. begin
  304. if cdoublein<>double(x) then
  305. raise jlexception.create('const double in');
  306. end;
  307. fsetint:
  308. begin
  309. if csetintin<>tsetint(x) then
  310. raise jlexception.create('const setint in');
  311. end;
  312. fsetenum:
  313. begin
  314. if csetenumin<>tsetenum(x) then
  315. raise jlexception.create('const setenum in');
  316. end;
  317. frec:
  318. begin
  319. if crecin.a<>trec(x).a then
  320. raise jlexception.create('const rec.a in');
  321. if crecin.b[3]<>trec(x).b[3] then
  322. raise jlexception.create('const rec.b[3] in');
  323. if crecin.b[4]<>trec(x).b[4] then
  324. raise jlexception.create('const rec.b[4] in');
  325. end;
  326. fshortstring:
  327. begin
  328. if cshortstringin<>shortstring(x) then
  329. raise jlexception.create('const shortstring in');
  330. end;
  331. funicodestring:
  332. begin
  333. if cunicodestringin<>unicodestring(x) then
  334. raise jlexception.create('const unicodestring in');
  335. end;
  336. farrbyte:
  337. begin
  338. for i:=low(carrbytein) to high(carrbytein) do
  339. if carrbytein[i]<>tarrbyte(x)[i] then
  340. raise jlexception.create('const arrbyte in');
  341. end;
  342. farrset:
  343. begin
  344. for i:=low(carrsetin) to high(carrsetin) do
  345. if carrsetin[i]<>tarrset(x)[i] then
  346. raise jlexception.create('const arrset in');
  347. end;
  348. end;
  349. end;
  350. procedure testformalvars;
  351. var
  352. vboolean: boolean;
  353. vbyte: byte;
  354. vsmallint: smallint;
  355. vcardinal: cardinal;
  356. vint64: int64;
  357. vchar: ansichar;
  358. vwidechar: widechar;
  359. vsingle: single;
  360. vdouble: double;
  361. vsetint: tsetint;
  362. vsetenum: tsetenum;
  363. vrec: trec;
  364. vshortstring: shortstring;
  365. vunicodestring: unicodestring;
  366. varrbyte: tarrbyte;
  367. varrset: tarrset;
  368. i: longint;
  369. begin
  370. vboolean:=cbooleanin;
  371. testformalvar(vboolean,fboolean);
  372. if vboolean<>cbooleanout then
  373. raise jlexception.create('boolean out');
  374. vbyte:=cbytein;
  375. testformalvar(vbyte,fbyte);
  376. if vbyte<>cbyteout then
  377. raise jlexception.create('byte out');
  378. vsmallint:=csmallintin;
  379. testformalvar(vsmallint,fsmallint);
  380. if vsmallint<>csmallintout then
  381. raise jlexception.create('smallint out');
  382. vunicodestring:=widechar(csmallintin);
  383. testformalvar(smallint(vunicodestring[1]),fsmallint);
  384. if smallint(vunicodestring[1])<>csmallintout then
  385. raise jlexception.create('stringsmallint out');
  386. vcardinal:=ccardinalin;
  387. testformalvar(vcardinal,fcardinal);
  388. if vcardinal<>ccardinalout then
  389. raise jlexception.create('cardinal out');
  390. vint64:=cint64in;
  391. testformalvar(vint64,fint64);
  392. if vint64<>cint64out then
  393. raise jlexception.create('int64 out');
  394. vchar:=ccharin;
  395. testformalvar(vchar,fchar);
  396. if vchar<>ccharout then
  397. raise jlexception.create('char out');
  398. vwidechar:=cwidecharin;
  399. testformalvar(vwidechar,fwidechar);
  400. if vwidechar<>cwidecharout then
  401. raise jlexception.create('widechar out');
  402. vunicodestring:=cwidecharin;
  403. testformalvar(vunicodestring[1],fwidechar);
  404. if vunicodestring[1]<>cwidecharout then
  405. raise jlexception.create('stringwidechar out');
  406. vsingle:=csinglein;
  407. testformalvar(vsingle,fsingle);
  408. if vsingle<>csingleout then
  409. raise jlexception.create('single out');
  410. vdouble:=cdoublein;
  411. testformalvar(vdouble,fdouble);
  412. if vdouble<>cdoubleout then
  413. raise jlexception.create('double out');
  414. vsetint:=csetintin;
  415. testformalvar(vsetint,fsetint);
  416. if vsetint<>csetintout then
  417. raise jlexception.create('setint out');
  418. vsetenum:=csetenumin;
  419. testformalvar(vsetenum,fsetenum);
  420. if vsetenum<>csetenumout then
  421. raise jlexception.create('setenum out');
  422. vrec:=crecin;
  423. testformalvar(vrec,frec);
  424. if crecout.a<>vrec.a then
  425. raise jlexception.create('rec.a out');
  426. if crecout.b[3]<>vrec.b[3] then
  427. raise jlexception.create('rec.b[3] out');
  428. if crecout.b[4]<>vrec.b[4] then
  429. raise jlexception.create('rec.b[4] out');
  430. vshortstring:=cshortstringin;
  431. testformalvar(vshortstring,fshortstring);
  432. if vshortstring<>cshortstringout then
  433. raise jlexception.create('shortstring out');
  434. vunicodestring:=cunicodestringin;
  435. testformalvar(vunicodestring,funicodestring);
  436. if vunicodestring<>cunicodestringout then
  437. raise jlexception.create('unicodestring out');
  438. varrbyte:=carrbytein;
  439. testformalvar(varrbyte,farrbyte);
  440. for i:=low(carrbyteout) to high(carrbyteout) do
  441. if carrbyteout[i]<>varrbyte[i] then
  442. raise jlexception.create('arrbyte out');
  443. varrset:=carrsetin;
  444. testformalvar(varrset,farrset);
  445. for i:=low(carrsetout) to high(carrsetout) do
  446. if varrset[i]<>carrsetout[i] then
  447. raise jlexception.create('arrset out');
  448. end;
  449. procedure testformalouts;
  450. var
  451. vboolean: boolean;
  452. vbyte: byte;
  453. vsmallint: smallint;
  454. vcardinal: cardinal;
  455. vint64: int64;
  456. vchar: ansichar;
  457. vwidechar: widechar;
  458. vsingle: single;
  459. vdouble: double;
  460. vsetint: tsetint;
  461. vsetenum: tsetenum;
  462. vrec: trec;
  463. vshortstring: shortstring;
  464. vunicodestring: unicodestring;
  465. varrbyte: tarrbyte;
  466. varrset: tarrset;
  467. i: longint;
  468. begin
  469. vboolean:=cbooleanin;
  470. testformalout(vboolean,fboolean);
  471. if vboolean<>cbooleanout then
  472. raise jlexception.create('out boolean out');
  473. vbyte:=cbytein;
  474. testformalout(vbyte,fbyte);
  475. if vbyte<>cbyteout then
  476. raise jlexception.create('out byte out');
  477. vsmallint:=csmallintin;
  478. testformalout(vsmallint,fsmallint);
  479. if vsmallint<>csmallintout then
  480. raise jlexception.create('out smallint out');
  481. vunicodestring:=widechar(csmallintin);
  482. testformalout(smallint(vunicodestring[1]),fsmallint);
  483. if smallint(vunicodestring[1])<>csmallintout then
  484. raise jlexception.create('out stringsmallint out');
  485. vcardinal:=ccardinalin;
  486. testformalout(vcardinal,fcardinal);
  487. if vcardinal<>ccardinalout then
  488. raise jlexception.create('out cardinal out');
  489. vint64:=cint64in;
  490. testformalout(vint64,fint64);
  491. if vint64<>cint64out then
  492. raise jlexception.create('out int64 out');
  493. vchar:=ccharin;
  494. testformalout(vchar,fchar);
  495. if vchar<>ccharout then
  496. raise jlexception.create('out char out');
  497. vwidechar:=cwidecharin;
  498. testformalout(vwidechar,fwidechar);
  499. if vwidechar<>cwidecharout then
  500. raise jlexception.create('out widechar out');
  501. vunicodestring:=cwidecharin;
  502. testformalout(vunicodestring[1],fwidechar);
  503. if vunicodestring[1]<>cwidecharout then
  504. raise jlexception.create('out stringwidechar out');
  505. vsingle:=csinglein;
  506. testformalout(vsingle,fsingle);
  507. if vsingle<>csingleout then
  508. raise jlexception.create('out single out');
  509. vdouble:=cdoublein;
  510. testformalout(vdouble,fdouble);
  511. if vdouble<>cdoubleout then
  512. raise jlexception.create('out double out');
  513. vsetint:=csetintin;
  514. testformalout(vsetint,fsetint);
  515. if vsetint<>csetintout then
  516. raise jlexception.create('out setint out');
  517. vsetenum:=csetenumin;
  518. testformalout(vsetenum,fsetenum);
  519. if vsetenum<>csetenumout then
  520. raise jlexception.create('out setenum out');
  521. vrec:=crecin;
  522. testformalout(vrec,frec);
  523. if crecout.a<>vrec.a then
  524. raise jlexception.create('out rec.a out');
  525. if crecout.b[3]<>vrec.b[3] then
  526. raise jlexception.create('out rec.b[3] out');
  527. if crecout.b[4]<>vrec.b[4] then
  528. raise jlexception.create('out rec.b[4] out');
  529. vshortstring:=cshortstringin;
  530. testformalout(vshortstring,fshortstring);
  531. if vshortstring<>cshortstringout then
  532. raise jlexception.create('out shortstring out');
  533. vunicodestring:=cunicodestringin;
  534. testformalout(vunicodestring,funicodestring);
  535. if vunicodestring<>cunicodestringout then
  536. raise jlexception.create('out unicodestring out');
  537. varrbyte:=carrbytein;
  538. testformalout(varrbyte,farrbyte);
  539. for i:=low(carrbyteout) to high(carrbyteout) do
  540. if carrbyteout[i]<>varrbyte[i] then
  541. raise jlexception.create('out arrbyte out');
  542. varrset:=carrsetin;
  543. testformalout(varrset,farrset);
  544. for i:=low(carrsetout) to high(carrsetout) do
  545. if varrset[i]<>carrsetout[i] then
  546. raise jlexception.create('out arrset out');
  547. end;
  548. procedure testformalconsts;
  549. var
  550. vboolean: boolean;
  551. vbyte: byte;
  552. vsmallint: smallint;
  553. vcardinal: cardinal;
  554. vint64: int64;
  555. vchar: ansichar;
  556. vwidechar: widechar;
  557. vsingle: single;
  558. vdouble: double;
  559. vsetint: tsetint;
  560. vsetenum: tsetenum;
  561. vrec: trec;
  562. vshortstring: shortstring;
  563. vunicodestring: unicodestring;
  564. varrbyte: tarrbyte;
  565. varrset: tarrset;
  566. i: longint;
  567. begin
  568. vboolean:=cbooleanin;
  569. testformalconst(vboolean,fboolean);
  570. if vboolean<>cbooleanin then
  571. raise jlexception.create('const boolean out');
  572. vbyte:=cbytein;
  573. testformalconst(vbyte,fbyte);
  574. if vbyte<>cbytein then
  575. raise jlexception.create('const byte out');
  576. vsmallint:=csmallintin;
  577. testformalconst(vsmallint,fsmallint);
  578. if vsmallint<>csmallintin then
  579. raise jlexception.create('const smallint out');
  580. vunicodestring:=widechar(csmallintin);
  581. testformalconst(smallint(vunicodestring[1]),fsmallint);
  582. if smallint(vunicodestring[1])<>csmallintin then
  583. raise jlexception.create('const stringsmallint out');
  584. vcardinal:=ccardinalin;
  585. testformalconst(vcardinal,fcardinal);
  586. if vcardinal<>ccardinalin then
  587. raise jlexception.create('const cardinal out');
  588. vint64:=cint64in;
  589. testformalconst(vint64,fint64);
  590. if vint64<>cint64in then
  591. raise jlexception.create('const int64 out');
  592. vchar:=ccharin;
  593. testformalconst(vchar,fchar);
  594. if vchar<>ccharin then
  595. raise jlexception.create('const char out');
  596. vwidechar:=cwidecharin;
  597. testformalconst(vwidechar,fwidechar);
  598. if vwidechar<>cwidecharin then
  599. raise jlexception.create('const widechar out');
  600. vunicodestring:=cwidecharin;
  601. testformalconst(vunicodestring[1],fwidechar);
  602. if vunicodestring[1]<>cwidecharin then
  603. raise jlexception.create('const stringwidechar out');
  604. vsingle:=csinglein;
  605. testformalconst(vsingle,fsingle);
  606. if vsingle<>csinglein then
  607. raise jlexception.create('const single out');
  608. vdouble:=cdoublein;
  609. testformalconst(vdouble,fdouble);
  610. if vdouble<>cdoublein then
  611. raise jlexception.create('const double out');
  612. vsetint:=csetintin;
  613. testformalconst(vsetint,fsetint);
  614. if vsetint<>csetintin then
  615. raise jlexception.create('const setint out');
  616. vsetenum:=csetenumin;
  617. testformalconst(vsetenum,fsetenum);
  618. if vsetenum<>csetenumin then
  619. raise jlexception.create('const setenum out');
  620. vrec:=crecin;
  621. testformalconst(vrec,frec);
  622. if crecin.a<>vrec.a then
  623. raise jlexception.create('const rec.a out');
  624. if crecin.b[3]<>vrec.b[3] then
  625. raise jlexception.create('const rec.b[3] out');
  626. if crecin.b[4]<>vrec.b[4] then
  627. raise jlexception.create('const rec.b[4] out');
  628. vshortstring:=cshortstringin;
  629. testformalconst(vshortstring,fshortstring);
  630. if vshortstring<>cshortstringin then
  631. raise jlexception.create('const shortstring out');
  632. vunicodestring:=cunicodestringin;
  633. testformalconst(vunicodestring,funicodestring);
  634. if vunicodestring<>cunicodestringin then
  635. raise jlexception.create('const unicodestring out');
  636. varrbyte:=carrbytein;
  637. testformalconst(varrbyte,farrbyte);
  638. for i:=low(carrbytein) to high(carrbytein) do
  639. if carrbytein[i]<>varrbyte[i] then
  640. raise jlexception.create('const arrbyte out');
  641. varrset:=carrsetin;
  642. testformalconst(varrset,farrset);
  643. for i:=low(carrsetin) to high(carrsetin) do
  644. if varrset[i]<>carrsetin[i] then
  645. raise jlexception.create('const arrset out');
  646. end;
  647. procedure main(args: array of string);
  648. begin
  649. test;
  650. testformalvars;
  651. testformalouts;
  652. testformalconsts;
  653. end;
  654. end.