Trailing-Edge
-
PDP-10 Archives
-
decus_20tap1_198111
-
decus/20-0002/test.sai
There is 1 other file named test.sai in the archive. Click here to see a list.
COMMENT VALID 00015 PAGES
RECORD PAGE DESCRIPTION
00001 00001
00005 00002 Sail Tester
00006 00003 Item Consistency Check
00007 00004 Allocator Test, Comment in Funny Places Test.
00008 00005 Forward Procedure Checks
00010 00006 Binary Operation Tests
00012 00007 StartCode Opcode Test
00013 00008 Inchwl Test.
00015 00009 String-Creation Test
00020 00010 Constant Procedures Test
00022 00011 Scan Test
00026 00012 Fullword Test
00030 00013 Real String Conversion Test, Preload Test
00034 00014 Constant Boolean Expression Test
00036 00015 Random Simple Things Tests.
00038 ENDMK
;
COMMENT Sail Tester;
BEGIN "TEST"
COMMENT This program is a comprehensive test of new features added to
SAIL since February, 1972.
The first section includes features added or modified as of 2-7-72;
DEFINE CRLF="('15&'12)";
EXTERNAL INTEGER SKIP;
BOOLEAN PROCEDURE WANT(STRING TEST);
BEGIN OUTSTR(TEST&"? ");
RETURN(INCHWL="Y");
END "WANT";
COMMENT Item Consistency Check
Be sure that item numbers start at the same place, with or with
declared items. First try it with ITEM IT as a declaration, then
without. IT should have the value 11. The NEW should be 11 if IT
is not declared, else 12;
COMMENT ITEM IT; REQUIRE 3 NEWITEMS; COMMENT IT SHOULD BE NUMBER 11;
IF WANT("ITEMVAR TEST") THEN BEGIN "ITEMVARS"
ITEMVAR X;
X_NEW; COMMENT THIS SHOULD BE NUMBER 12 -- 11 IF ITEM DECL REMOVED;
OUTSTR(CVS(CVN(X)) & CRLF);
END "ITEMVARS";
COMMENT Allocator Test, Comment in Funny Places Test.
Make sure that double-pp request and smaller-than-default
String-pp request work ok.
Also (5-12-72) make sure that Comments after declared names
don't foul up the declarations;
REQUIRE 125 SYSTEMPDL, 300 SYSTEMPDL, 30 STRINGPDL;
BEGIN
INTEGER IXI COMMENT IF THINGS ARE BROKEN, "COMMENT" WILL BE DEFINED;;
PROCEDURE XXX; IXI_3;
COMMENT IF THINGS ARE BROKEN, THIS COMMENT WILL BE BROKEN;
END;
COMMENT Forward Procedure Checks
This test made entirely at compile time. The following procedures have
errors:
P2 -- FORWARD has too few formals
P3 -- FORWARD has too many formals
P4 -- FORWARD has too few formals
P5 -- FORWARD has too many formals
P6 -- FORWARD and actual have different names, but types match, OK.
P7 -- Type mismatch
P8 -- No FORWARD, no error -- all OK
Enable this test by Truifying the IFC;
IFC FALSE THENC
BEGIN "FORWARDS"
FORWARD PROCEDURE P1;
PROCEDURE P1;;
FORWARD PROCEDURE P2;
PROCEDURE P2(INTEGER X);;
FORWARD PROCEDURE P3(INTEGER X);
PROCEDURE P3;;
FORWARD PROCEDURE P4(INTEGER X);
PROCEDURE P4(INTEGER X,Y);;
FORWARD PROCEDURE P5(INTEGER X,Y);
PROCEDURE P5(INTEGER X);;
FORWARD PROCEDURE P6(INTEGER X);
PROCEDURE P6(INTEGER Z);;
FORWARD PROCEDURE P7(INTEGER X);
PROCEDURE P7(REAL X);;
PROCEDURE P8(INTEGER X;STRING Y);;
END "FORWARDS";
ENDC
COMMENT Binary Operation Tests
This test was designed specifically to test binary operations which
have two STTEMPs as operands. However, it is mildly useful
to check other binary operations as well. Just watch the
flashing lights.
;
IF WANT("BINARY TEST") THEN BEGIN "BINARY OPS"
DEFINE BTEST(OP,RES)="
IF (OP)RES THEN OUTSTR(""BINARY OPERATION `OP' YIELDS ""&
CVS(I)&"", SHOULD BE RES""&CRLF)";
INTEGER I,J; STRING S,T;
J_5;
BTEST(I_2-3,-1);
BTEST(I_J-3,2);
BTEST(I_I-3,-1);
I_2;
BTEST(I_I^J,32);
S_"EFG"; T_"ABCD";
BTEST(I_S-T,4);
S_3&4&5&6&7; I_2;
T_7&6&5&4&3;
BTEST(I_I^S,8);
BTEST(I_S[3 FOR 1]+I,13);
BTEST(I_S[3 FOR 1]^T[4 FOR 1],625);
BTEST(I_IF I>J THEN 3 ELSE 4,3);
BTEST(I_IF S[3 FOR 1]>T[4 FOR 1] THEN 3 ELSE 4,3);
END "BINARY OPS";
COMMENT StartCode Opcode Test
All opcodes are now available in STARTCODE.
CALL is the first opcode, and has the value 40.
INTUUO is the last, with value 723.
MOVE is in the middle, with value 200.
Correct compilation of these instructions does not guarantee
correctness of all opcodes, but it does eliminate systematic error.
This code will not be executed -- just examine it;
IF FALSE THEN STARTCODE "OPCODES"
CALL 1,1; COMMENT TEST FIRST OPCODE;
COMMENT INTUUO 1,1; COMMENT TEST LAST OPCODE;
MOVE 1,1; COMMENT TEST SOMETHING IN THE MIDDLE;
END "OPCODES";
COMMENT Inchwl Test.
INCHWL now stops on ANY activation character, returning that
character in SKIP, not in the string. It sucks up
the LF after a CR, returning the CR.
This test will tell you if it doesn't like you;
IF WANT("INCHWL TEST") THEN BEGIN "INCHWL"
STRING S;
OUTSTR("TYPE ""THIS IS A LINE"", TERMINATE WITH <CR>"&CRLF);
IF EQU("THIS IS A LINE",S_INCHWL)
THEN OUTSTR("STRING RESULT WRONG"&CRLF);
IF SKIP'15 THEN OUTSTR("BREAK CHAR WRONG"&CRLF);
OUTSTR("TYPE ""THIS IS A LINE"", TERMINATE WITH <LF>"&CRLF);
IF EQU("THIS IS A LINE",S_INCHWL)
THEN OUTSTR("STRING RESULT WRONG"&CRLF);
IF SKIP'12 THEN OUTSTR("BREAK CHAR WRONG"&CRLF);
OUTSTR("TYPE ""THIS IS A LINE"", TERMINATE WITH <ALT>"&CRLF);
IF EQU("THIS IS A LINE",S_INCHWL)
THEN OUTSTR("STRING RESULT WRONG"&CRLF);
IF SKIP'175 THEN OUTSTR("BREAK CHAR WRONG"&CRLF);
OUTSTR("TYPE ""THIS IS A LINE"", TERMINATE WITH <CTRL-D>"&CRLF);
IF EQU("THIS IS A LINE",S_INCHWL)
THEN OUTSTR("STRING RESULT WRONG"&CRLF);
IF SKIP'304 THEN OUTSTR("BREAK CHAR WRONG"&CRLF)
END "INCHWL";
COMMENT String-Creation Test
This just runs CAT and friends through their paces. It was designed
to test the new optimized CAT, CATCHR, CHRCAT, CHRCHR, and to
make sure that the removal of TOPSTR didn't blow the other
string-making routines. Sometimes help is requested from the TTY.
A new test (5-12-72) assures that if SGLIGN(USER) is on, strings are
aligned on full-word boundaries after concatenation, even if
optimization must be removed. ;
IF WANT("STRING TEST") THEN BEGIN "STRING CREATION"
INTEGER I,J; STRING S,T; EXTERNAL INTEGER SGLIGN;
BOOLEAN PROCEDURE UNALIGNED(REFERENCE STRING S);
BEGIN INTEGER I;
STARTCODE MOVE 1,S; LSH 1,-30; MOVEM 1,I END;
RETURN(IF 1I'44 THEN TRUE ELSE FALSE);
END "UNALIGNED";
S_NULL;
T_"ABC";
IF EQU(S_T&"CDE","ABCCDE") THEN
OUTSTR("CAT WITH TWO COPIES DOESN'T WORK");
IF EQU(S&"CDE"&CVS(32456),"ABCCDECDE32456") THEN
OUTSTR("CAT WITH ONE COPY, OR WITH NO COPY DOESN'T WORK"&CRLF);
I_"G";
IF EQU(T&I,"ABCG") THEN OUTSTR("CATCHR DOESN'T WORK"&CRLF);
IF EQU(I&T,"GABC") THEN OUTSTR("CHRCAT DOESN'T WORK"&CRLF);
IF EQU(I&I,"GG") THEN OUTSTR("CHRCHR DOESN'T WORK"&CRLF);
FOR J_1 STEP 1 UNTIL 20 DO BEGIN
T_S;
S_NULL;
FOR I_1 STEP 1 UNTIL 200 DO S_S&" "&CVS(I); COMMENT JUST APPEND;
END;
IF EQU(S,T) THEN OUTSTR("STRNGC MESSED UP CAT"&CRLF);
USERCON(SGLIGN,I_-1,1);
S_"ABCDE"; S_S&"FGHIJ"; T_S[3 FOR 8];
T_T&CVS(25);
BEGIN "SGLIGN TEST" I_0 END;
IF UNALIGNED(S) THEN OUTSTR("SGLIGN DIDN'T WORK AT ALL"&CRLF);
IF UNALIGNED(T) THEN
OUTSTR("SGLIGN DIDN'T WORK IF ALREADY CATTED"&CRLF);
S_"ABCDE"; S_S&"FGHIJ"; T_S[3 FOR 8]; T_T&"ABCDE";
IF UNALIGNED(T) THEN
OUTSTR("SGLIGN DIDN'T WORK IF ARG1 ON TOP"&CRLF);
USERCON(SGLIGN,I_0,1);
SETBREAK(1,"ABCDE",NULL,"I");
S_"THIS IS A LINE";
T_SCAN(S,1,I);
IF EQU(T,"THIS IS ")EQU(S," LINE") THEN
OUTSTR("SCAN DOESN'T WORK"&CRLF);
IF INTSCAN(S_"12345ABCDE",J)12345 THEN
OUTSTR("INTSCAN DOESN'T WORK"&CRLF);
IF (1.1@-4REALSCAN(S_"1.23@-4ABCDE",J)1.3@-4) THEN
OUTSTR("REALSCAN DOESN'T WORK"&CRLF);
IF EQU(CVSTR(CVASC("ABCDE")),"ABCDE") THEN
OUTSTR("CVSTR OR CVASC DOESN'T WORK"&CRLF);
IF EQU(CVXSTR(CVSIX("ABCDEF")),"ABCDEF") THEN
OUTSTR("CVXSTR OR CVSIX DOESN'T WORK"&CRLF);
OPEN(1,"TTY",0,2,0,100,I,I);
OUTSTR("TYPE ""THIS IS A LINE""<CRLF>"&CRLF);
SETBREAK(1,10,13,"I");
S_INPUT(1,1);
IF EQU("THIS IS A LINE",S)I'12 THEN
OUTSTR("INPUT DOESN'T WORK"&CRLF);
OUTSTR("TYPE ""12345 1.23@-4""<CRLF>"&CRLF);
IF INTIN(1)12345 THEN
OUTSTR("INTIN DOESN'T WORK"&CRLF);
IF (1.1@-4REALIN(1)1.3@-4) THEN
OUTSTR("REALIN DOESN'T WORK"&CRLF);
RELEASE(1);
END "STRING CREATION";
COMMENT Constant Procedures Test
This test assures that CAT, SUBSTR, CVS, CVOS, ... CVD, CVO, EQU
will happen correctly at compile time. Part of it assures that
procedures with wrong numbers of arguments will not be evaluated.;
IF WANT("CONSTANT PROCEDURES TEST") THEN BEGIN "CONST PROC"
INTEGER I; STRING ST;
IFC EQU("ABC"&"DEF","ABCDEF") THENC
OUTSTR("CONSTANT CAT DOESN'T WORK"&CRLF); ENDC
IFC EQU("ABC"&CRLF,"ABC
") THENC OUTSTR("CONSTANT CAT DOESN'T WORK"&CRLF); ENDC
IFC EQU(("ABCDE")[2 TO 4],"BCD") THENC
OUTSTR("CONSTANT SUBSTR DOESN'T WORK"&CRLF); ENDC
SETFORMAT(0,0);
IF EQU(CVS(25),"25") THEN OUTSTR("CONSTANT CVS DOESN'T WORK"&CRLF);
SETFORMAT(10,5);
IFC TRUE THENC
BEGIN "CVG TEST" I_0 END;
IF EQU(CVG(-3.5),"-3.500000 ") THEN
OUTSTR("CONSTANT CVG DOESN'T WORK"&CRLF);
ENDC
IFC CVD("12345")12345 THENC
OUTSTR("CONSTANT CVD DOESN'T WORK"&CRLF); ENDC
IFC FALSE THENC COMMENT WE'LL DO OUR BEST, BUT ... ;
I_EQU("ABC");
I_EQU("ABC","CDE","EFG");
I_CVD;
I_CVD("ABC","DEF");
ST_CVS;
ST_CVS(2,3,4);
ENDC
END "CONST PROC";
COMMENT Scan Test
This was designed to test SCAN in all its many guises.
It will tell you what it doesn't like;
IF WANT("SCAN TEST") THEN BEGIN "SCAN TEST"
PROCEDURE OUTSTR(STRING S);
BEGIN "OUTSTR"
EXTERNAL PROCEDURE OUTSTR(STRING S);
OUTSTR(S&CRLF)
END "OUTSTR";
STRING S,T; INTEGER I;
SETBREAK(1,"ABCD",NULL,"I");
SETBREAK(2,"ABCD"," ","I");
SETBREAK(3,"ABCD",NULL,"IA");
SETBREAK(4,"ABCD",NULL,"IR");
S_NULL;
IF EQU(T_SCAN(S,1,I),NULL)EQU(S,NULL)I0 THEN
OUTSTR("SCAN 1 DOESN'T WORK");
S_"A LINE IS THIS";
IF EQU(T_SCAN(S,1,I),NULL)EQU(S," LINE IS THIS")I"A"
THEN OUTSTR("SCAN 2 DOESN'T WORK");
S_"THIS IS A LINE";
IF EQU(T_SCAN(S,1,I),"THIS IS ") EQU(S," LINE")I"A"
THEN OUTSTR("SCAN 3 DOESN'T WORK");
S_"THIS LINE IS A";
IF EQU(T_SCAN(S,1,I),"THIS LINE IS ")EQU(S,NULL)I"A"
THEN OUTSTR("SCAN 4 DOESN'T WORK");
S_"THIS IS LINE";
IF EQU(T_SCAN(S,1,I),"THIS IS LINE")EQU(S,NULL)I0
THEN OUTSTR("SCAN 5 DOESN'T WORK");
S_"A LINE IS THIS";
IF EQU(T_SCAN(S,2,I),NULL)EQU(S," LINE IS THIS")I"A"
THEN OUTSTR("SCAN 6 DOESN'T WORK");
S_"THIS IS A LINE";
IF EQU(T_SCAN(S,2,I),"THISIS") EQU(S," LINE")I"A"
THEN OUTSTR("SCAN 7 DOESN'T WORK");
S_"THIS LINE IS A";
IF EQU(T_SCAN(S,2,I),"THISLINEIS")EQU(S,NULL)I"A"
THEN OUTSTR("SCAN 8 DOESN'T WORK");
S_"THIS IS LINE";
IF EQU(T_SCAN(S,2,I),"THISISLINE")EQU(S,NULL)I0
THEN OUTSTR("SCAN 9 DOESN'T WORK");
S_"A LINE IS THIS";
IF EQU(T_SCAN(S,3,I),"A")EQU(S," LINE IS THIS")I"A"
THEN OUTSTR("SCAN 10 DOESN'T WORK");
S_"THIS IS A LINE";
IF EQU(T_SCAN(S,3,I),"THIS IS A") EQU(S," LINE")I"A"
THEN OUTSTR("SCAN 11 DOESN'T WORK");
S_"THIS LINE IS A";
IF EQU(T_SCAN(S,3,I),"THIS LINE IS A")EQU(S,NULL)I"A"
THEN OUTSTR("SCAN 12 DOESN'T WORK");
S_"THIS IS LINE";
IF EQU(T_SCAN(S,3,I),"THIS IS LINE")EQU(S,NULL)I0
THEN OUTSTR("SCAN 13 DOESN'T WORK");
S_"A LINE IS THIS";
IF EQU(T_SCAN(S,4,I),NULL)EQU(S,"A LINE IS THIS")I"A"
THEN OUTSTR("SCAN 14 DOESN'T WORK");
S_"THIS IS A LINE";
IF EQU(T_SCAN(S,4,I),"THIS IS ") EQU(S,"A LINE")I"A"
THEN OUTSTR("SCAN 15 DOESN'T WORK");
S_"THIS LINE IS A";
IF EQU(T_SCAN(S,4,I),"THIS LINE IS ")EQU(S,"A")I"A"
THEN OUTSTR("SCAN 16 DOESN'T WORK");
S_"THIS IS LINE";
IF EQU(T_SCAN(S,4,I),"THIS IS LINE")EQU(S,NULL)I0
THEN OUTSTR("SCAN 17 DOESN'T WORK");
END "SCAN TEST";
COMMENT Fullword Test
This tests WORDIN, WORDOUT, ARRYIN, ARROUT in many ways. It
complains if it doesn't like you;
IF WANT("FULLWORD IO TEST") THEN BEGIN "FULLWORD TRANSFERS"
INTEGER EOF,I,J;
INTEGER ARRAY X[0:383];
PROCEDURE CHECKB(INTEGER FLAG);
BEGIN "CHECKB"
INTEGER L,H;
I_POINT(36,X[0],35);
IF FLAG THEN L_LDB(I-1) ELSE IF
LLDB(I-1) THEN OUTSTR("LOWER BOUND CLOBBERED IN FULLWORD"&CRLF);
IF FLAG THEN H_LDB(I+384) ELSE IF
HLDB(I+384) THEN OUTSTR("UPPER BOUND CLOBBERED IN FULLWORD"&CRLF);
END "CHECKB";
CHECKB(TRUE);
OPEN(1,"DSK",'10,0,2,0,I,EOF);
ENTER(1,"TEST.DAT",I);
FOR I_0 STEP 1 UNTIL 383 DO X[I]_I;
BEGIN "WR FILE" END "WR FILE";
ARRYOUT(1,X[0],128); "ONE RECORD"
ARRYOUT(1,X[I_128],29); "WITHIN A RECORD"
ARRYOUT(1,X[I_I+29],113); "ACROSS A RECORD BOUNDARY"
WORDOUT(1,X[I_I+113]); "A SINGLE WORD"
ARRYOUT(1,X[I_I+1],113); "LAST GROUP, 3 RECORDS TOTAL"
RELEASE(1);
CHECKB(FALSE); "MAKE SURE NOTHING HAS MOVED"
X[0]_-1; ARRBLT(X[1],X[0],383);
OPEN(1,"DSK",'10,2,0,0,I,EOF);
LOOKUP(1,"TEST.DAT",I);
BEGIN "RD FILE" END "RD FILE";
ARRYIN(1,X[0],113); "READ WITHIN RECORD"
X[I_113]_WORDIN(1); "ONE WORD, SAME RECORD"
ARRYIN(1,X[I_I+1],28); "ACROSS BOUNDARY"
ARRYIN(1,X[I_I+28],114); "FINISH UP THE RECORD"
ARRYIN(1,X[I_I+114],129); "READ ONE PAST EOF"
BEGIN "EOF CHK" END "EOF CHK";
IF EOF THEN OUTSTR("EOF DOESN'T WORK IN WORDIN"&CRLF) ELSE
IF EOF('20010 LSH 18)+128 THEN OUTSTR("EOF WITH BAD VALUE"&CRLF);
RELEASE(1);
CHECKB(FALSE);
FOR I_0 STEP 1 UNTIL 383 DO IF X[I]I THEN
OUTSTR("WORD "&CVS(I)&" HAS VALUE "&CVS(X[I])&CRLF);
OPEN(1,"DSK",'17,0,0,0,I,EOF);
ENTER(1,"TEST.DAT",I);
FOR I_1 STEP 1 UNTIL 10 DO WORDOUT(1,I);
RELEASE(1);
OPEN(1,"DSK",'17,0,0,0,I,I);
LOOKUP(1,"TEST.DAT",I);
BEGIN "DMP RD TEST" END "DMP RD TEST";
FOR J_1 STEP 1 UNTIL 10 DO IF (I_WORDIN(1))J THEN
OUTSTR("DUMP MODE: WORD "&CVS(J)&" HAS VALUE "&CVS(I)&CRLF);
RELEASE(1)
END "FULLWORD TRANSFERS";
COMMENT Real String Conversion Test, Preload Test
This tests CVE, CVF, CVG. I test so much because once I modified
the spacing algorithm, and now that I put it back I don't
trust it;
IF WANT("REALSTRING TEST") THEN BEGIN "REALSTRING CONVERSIONS"
STRING S,COD; REAL X;INTEGER I;
SETFORMAT(0,0);
X_3.5;
IF EQU(CVE(X)," @0 ") THEN OUTSTR("CVE 1 IS WRONG"&CRLF);
IF EQU(CVF(X)," 4.") THEN OUTSTR("CVF 2 IS WRONG"&CRLF);
IF EQU(CVG(X)," @0 ") THEN OUTSTR("CVG 3 IS WRONG"&CRLF);
SETFORMAT(10,5);
IF EQU(CVE(X)," .35000@1 ") THEN OUTSTR("CVE 4 IS WRONG"&CRLF);
IF EQU(CVF(X)," 3.50000") THEN OUTSTR("CVF 5 IS WRONG"&CRLF);
IF EQU(CVG(X)," 3.5000 ") THEN OUTSTR("CVG 6 IS WRONG"&CRLF);
SETFORMAT(-1,0);
IF EQU(CVE(X)," @0 ") THEN OUTSTR("CVE 7 IS WRONG"&CRLF);
IF EQU(CVF(X)," 4.") THEN OUTSTR("CVF 8 IS WRONG"&CRLF);
IF EQU(CVG(X)," @0 ") THEN OUTSTR("CVG 9 IS WRONG"&CRLF);
SETFORMAT(-10,5);
IF EQU(CVE(X)," .35000@1 ") THEN OUTSTR("CVE 10 IS WRONG"&CRLF);
IF EQU(CVF(X)," 003.50000") THEN OUTSTR("CVF 11 IS WRONG"&CRLF);
IF EQU(CVG(X)," 3.5000 ") THEN OUTSTR("CVG 12 IS WRONG"&CRLF);
X_-3.5;SETFORMAT(0,0);
IF EQU(CVE(X),"- @0 ") THEN OUTSTR("CVE 13 IS WRONG"&CRLF);
IF EQU(CVF(X),"-4.") THEN OUTSTR("CVF 14 IS WRONG"&CRLF);
IF EQU(CVG(X),"- @0 ") THEN OUTSTR("CVG 15 IS WRONG"&CRLF);
SETFORMAT(10,5);
IF EQU(CVE(X),"-.35000@1 ") THEN OUTSTR("CVE 16 IS WRONG"&CRLF);
IF EQU(CVF(X)," -3.50000") THEN OUTSTR("CVF 17 IS WRONG"&CRLF);
IF EQU(CVG(X),"-3.5000 ") THEN OUTSTR("CVG 18 IS WRONG"&CRLF);
SETFORMAT(-1,0);
IF EQU(CVE(X),"- @0 ") THEN OUTSTR("CVE 19 IS WRONG"&CRLF);
IF EQU(CVF(X),"-4.") THEN OUTSTR("CVF 20 IS WRONG"&CRLF);
IF EQU(CVG(X),"- @0 ") THEN OUTSTR("CVG 21 IS WRONG"&CRLF);
SETFORMAT(-10,5);
IF EQU(CVE(X),"-.35000@1 ") THEN OUTSTR("CVE 22 IS WRONG"&CRLF);
IF EQU(CVF(X),"-003.50000") THEN OUTSTR("CVF 23 IS WRONG"&CRLF);
IF EQU(CVG(X),"-3.5000 ") THEN OUTSTR("CVG 24 IS WRONG"&CRLF);
END "REALSTRING CONVERSIONS";
IFC TRUE THENC
IF FALSE THEN BEGIN "PRELOAD WARNINGS"
DEFINE PRELOADWITH="COMMENT";
INTEGER N;
PRELOADWITH 0,0,0,0,0;
INTEGER ARRAY FOO[1:N];
PRELOADWITH 1,2,3,45;
EXTERNAL INTEGER ARRAY BAZ[1:N];
FOO[1]_3
END "PRELOAD WARNINGS";
ENDC
COMMENT Constant Boolean Expression Test
Enable and look at the code if you suspect something;
IFC FALSE THENC
BEGIN "BOOL"
INTEGER A,B;
IF A THEN B_3;
IF 3 THEN B_3;
IF A<B THEN B_3;
IF A<3 THEN B_3;
IF 3<A THEN B_3;
IF 3<5 THEN B_3;
IF 3>5 THEN B_3;
IF AB THEN B_3;
IF A(3<5) THEN B_3;
IF A(5<3) THEN B_3;
IF 5<3A THEN B_3;
IF A3 THEN B_3;
IF 3<54<7 THEN B_3;
IF 3<54>7 THEN B_3;
IF 3>54<7 THEN B_3;
IF 3>54>7 THEN B_3;
IF AB THEN B_3;
IF A(3<5) THEN B_3;
IF A(5<3) THEN B_3;
IF 5<3A THEN B_3;
IF A3 THEN B_3;
IF 3<54<7 THEN B_3;
IF 3<54>7 THEN B_3;
IF 3>54<7 THEN B_3;
IF 3>54>7 THEN B_3;
A_3<5(4>72<3);
A_IF 3<5(4>72<3) THEN 2 ELSE 3;
A_3<5(4>72>3);
A_IF 3<5(4>72>3) THEN 2 ELSE 3;
END "BOOL"
ENDC
COMMENT Random Simple Things Tests.
These should take very little time, and should always work.
It's just a way to assure that trivial bugs don't creep back in;
BEGIN "RANDOM"
STRING SS;
INTEGER I,J, K;
Comment be sure that NEGAT bug in Loop code is gone;
SS_"ABCDE";
J_1; K_0;
FOR I_1 STEP 1 UNTIL 10-LENGTH(SS) DO K_-1;
IF I6K THEN OUTSTR("NEGAT BUG IN FOR CODE IS BACK"&CRLF);
J_1; K_0;
FOR I_1 STEP J UNTIL 10-LENGTH(SS) DO K_-1;
IF I6K THEN OUTSTR("NEGAT BUG IN FOR CODE IS BACK"&CRLF);
Comment type the version number. Load this with something whose
Version numbers don't exist, are the same, are not the same;
STARTCODE MOVE 1,'137; MOVEM 1,I END;
OUTSTR("VERSION IS "&CVOS(I)&CRLF);
END "RANDOM"
END "TEST";