Hi,
As far as I remember so far we've seen that some numbers were put in SET
OF BYTE, but weren't found in by IN operator (which was acknowleged as a
bug for Alpha/64bit platform - I don't know whether the test failed on
any other architecture?).
This is a test which stresses other issue: I've found some numbers IN SET
which were NOT added to it! (Only on Alpha/64bit, on 32bit Solaris all
tests pass with OK!).
Also initialization fails, but IMHO all this bugs have something in
common; so I went forth with these examples only in hope that they will
help nail the bug.
mirsad
The test is (all four new tests are in attachment for your convenience):
--mirsad05.pas------------------------------------------------------------
PROGRAM setranges5(output);
{ Written by: Mirsad Todorovac Nov 2001; copying by GPL.
------------------------------------------------------------
Stresses setrange construction and adding; checks if there's
more in SET than we've put in.
lasts few seconds where I've tested it.}
CONST maxN = 255;
VAR seta, setb, setc: SET OF 0..maxN;
i, j, len, start, endr: Cardinal;
failed: Boolean = false;
BEGIN
FOR i:= 0 TO maxN DO
IF ((i IN seta) OR (i IN setb) OR (i IN setc)) THEN
writeln('Failed: SET not initialized empty!');
FOR len:= 1 TO maxN+1 DO
BEGIN
FOR start:= 0 TO maxN-len+1 DO
BEGIN
endr := start+len-1;
{writeln('constr. range = ', start, ',', endr);}
setb := seta + [start .. endr];
FOR i:= 0 TO maxN DO
BEGIN
IF (((i < start) AND (i IN setb)) OR
((i > endr) AND (i IN setb))) THEN
IF (NOT failed) THEN
BEGIN
writeln('Failed: ', i,' outside range found IN SET! ',
'[',start, '..', endr,']');
{It's sufficient for one example to fail to find a bug!}
failed := True;
END
END
END
END;
IF (NOT failed) THEN
writeln('OK');
END.
-----------------------------------------------------------------------
--
This message has been made up using recycled ideas and language constructs.
No plant or animal has been injured in process of making this message.