BitOpsTest.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Barth, August 6, 1986 6:16:09 pm PDT
Spreitzer, September 17, 1985 1:27:02 pm PDT
DIRECTORY BitOps, IO, ViewerIO;
BitOpsTest: CEDAR PROGRAM
IMPORTS BitOps, IO, ViewerIO =
BEGIN
SimpleTest: PROC =
TRUSTED BEGIN OPEN BitOps, IO;
out: IO.STREAM ← ViewerIO.CreateViewerStreams["BitOpsTest"].out;
b: BOOL;
c: CARDINAL;
at: ARRAY [0..4) OF CARDINAL;
a: BitMWord ← DESCRIPTOR[at];
FOR i:CARDINAL IN [0..4) DO
at[i] ← 125252B;
ENDLOOP;
IF NOT (b ← EBFW[6,1,4]) THEN out.PutF["First EBFW failed with %b when expecting TRUE ", bool[b]];
IF (c ← IBIW[TRUE,6,3,4]) # 7B THEN out.PutF["First IBIW failed with %b when expecting 7 ", card[c]];
IF NOT (b ← EBFM[a,62,64]) THEN out.PutF["First EBFM failed with %b when expecting TRUE ", bool[b]];
IBIM[FALSE,a,62,64];
IF a[3] # 125250B THEN out.PutF["First IBIM failed with %b when expecting 125250B ", card[a[3]]];
IF (c ← ECFW[1,4,12,16]) # 1 THEN out.PutF["ECFW failed with %b when expecting 1 ", card[c]];
IF (c ← ICIW[1,1,0,1,16]) # 100001B THEN out.PutF["ICIW failed with %b when expecting 100001B ", card[c]];
IF (c ← ECFM[a,58,6,64]) # 50B THEN out.PutF["ECFM failed with %b when expecting 50B ", card[c]];
ICIM[1,a,62,1,64];
IF a[3] # 125252B THEN out.PutF["ICIM failed with %b when expecting 125252B ", card[a[3]]];
out.PutF["Done."];
out.Flush[];
END;
SimpleTest[];
END.