-- beadstest1.mesa
DIRECTORY IODefs:FROM"IODefs",
InlineDefs:FROM"InlineDefs",
BeadsDefs:FROM"BeadsDefs";
BeadsTest:PROGRAM IMPORTS IODefs, InlineDefs, BeadsDefs
EXPORTS BeadsDefs =
BEGIN OPEN BeadsDefs;
Error:SIGNAL=CODE;
FullTest:PUBLIC PROCEDURE=BEGIN
i,j:CARDINAL;
deltaX,deltaY:INTEGER;
beadi,beadj:Bead;
bpi,bpj:BeadPtr;
testFail:BOOLEAN←FALSE;
FOR i IN [0..topBead] DO
bpi←Get[i];
IF bpi.h<=0 OR bpi.w<=0 OR bpi.t=none THEN LOOP;
FOR j IN (i..topBead] DO
bpj←Get[j];
IF bpj.t=none THEN LOOP;
IF bpj.h<=0 OR bpj.w<=0 THEN LOOP;
[deltaX,deltaY]←Deltas[i,j];
IF bpj.x>=bpi.x+bpi.w+deltaX THEN LOOP;
IF bpi.x>=bpj.x+bpj.w+deltaX THEN LOOP;
IF bpj.y>=bpi.y+bpi.h+deltaY THEN LOOP;
IF bpi.y>=bpj.y+bpj.h+deltaY THEN LOOP;
IF desP[bpi.t].lessLevel#desP[bpj.t].lessLevel THEN LOOP;
IF bpj.beadT=i THEN LOOP;
IF bpi.circuit=bpj.circuit THEN LOOP;
SELECT j FROM
bpi.beadR,bpi.beadL,bpi.beadU,bpi.beadD,bpi.beadT=>LOOP;
ENDCASE;
beadi←bpi↑;
beadj←bpj↑;
IF ~testFail THEN Error;
testFail←TRUE;
IODefs.WriteChar[CR];
IODefs.WriteString["conflict between"];
IODefs.WriteNumber[i, [10,FALSE,TRUE,4]];
IODefs.WriteString[" and "];
IODefs.WriteNumber[j,[10,FALSE,TRUE,4]];
ENDLOOP; ENDLOOP;
END;
END..