DIRECTORY BitOps, BitSwOps, IO, SwitchTypes, ViewerIO; BitOpsTest: CEDAR PROGRAM IMPORTS BitOps, BitSwOps, IO, ViewerIO = BEGIN SimpleTest: PROC = TRUSTED BEGIN OPEN BitSwOps, BitOps, IO; none: SwitchTypes.Strength = SwitchTypes.none; out: IO.STREAM _ ViewerIO.CreateViewerStreams["BitOpsTest"].out; b: BOOL; c: CARDINAL; at: ARRAY [0..4) OF CARDINAL; a: BitMWord _ DESCRIPTOR[at]; s1, s2: PACKED ARRAY [0 .. 7) OF SwitchTypes.SwitchVal; sd1: SwitchMWord = DESCRIPTOR[s1]; sd2: SwitchMWord = DESCRIPTOR[s2]; FOR i:CARDINAL IN [0..4) DO at[i] _ 125252B; ENDLOOP; IF NOT (b _ EBFW[6,4,1]) THEN out.PutF["First EBFW failed with %b when expecting TRUE ", bool[b]]; IF (c _ IBIW[TRUE,6,4,3]) # 7B THEN out.PutF["First IBIW failed with %b when expecting 7 ", card[c]]; IF NOT (b _ EBFM[a,64,62]) THEN out.PutF["First EBFM failed with %b when expecting TRUE ", bool[b]]; IBIM[FALSE,a,64,62]; IF a[3] # 125250B THEN out.PutF["First IBIM failed with %b when expecting 125250B ", card[a[3]]]; IF (c _ ECFW[1,16,4,12]) # 1 THEN out.PutF["ECFW failed with %b when expecting 1 ", card[c]]; IF (c _ ICIW[1,1,16,0,1]) # 100001B THEN out.PutF["ICIW failed with %b when expecting 100001B ", card[c]]; IF (c _ ECFM[a,64,58,6]) # 50B THEN out.PutF["ECFM failed with %b when expecting 50B ", card[c]]; ICIM[1,a,64,62,1]; IF a[3] # 125252B THEN out.PutF["ICIM failed with %b when expecting 125252B ", card[a[3]]]; ICIS[source: 85, container: sd1, containerWidth: 7, fieldPosition: 0, fieldWidth: 7, si: q, how: [charge, drive]]; ICIS[source: 51, container: sd1, containerWidth: 7, fieldPosition: 0, fieldWidth: 7, si: u, how: [none, input]]; ICIS[source: 71, container: sd1, containerWidth: 7, fieldPosition: 0, fieldWidth: 7, si: d, how: [driveWeak, chargeStrong]]; MSTS[sourceContainer: sd1, sourceContainerWidth: 7, sourcePosition: 0, sourceWidth: 7, destinationContainer: sd2, destinationContainerWidth: 7, destinationPosition: 0, destinationWidth: 7]; FOR i: CARDINAL IN [0 .. 7) DO IF s1[i] # s2[i] THEN out.PutF["MSTS failed at %g\n", IO.card[i]]; s1[i].val _ IF (i MOD 2) = 0 THEN L ELSE H; IF s1[6-i].s # [IF (i MOD 2) < 1 THEN drive ELSE charge, IF (i MOD 4) < 2 THEN input ELSE none, IF (i MOD 6) < 3 THEN chargeStrong ELSE driveWeak] THEN out.PutF["ICIS failed at %g\n", IO.card[i]]; ENDLOOP; IF ECFS[container: sd1, containerWidth: 7, fieldPosition: 1, fieldWidth: 6] # 42 THEN out.PutF["ECFS failed\n"]; out.PutF["Done."]; out.Flush[]; END; SimpleTest[]; END. ~BitOpsTest.mesa Last edited by: Barth, December 8, 1983 10:29 am Last Edited by: Spreitzer, May 3, 1985 2:50:47 pm PDT ΚΛ˜Icodešœ™Kšœ0™0Kšœ5™5K™KšΟk œœ˜6K˜šΠbx œœ˜Kšœœ ˜(—K˜Kš˜K˜šΟn œœ˜Kšœœœœ˜(K˜.K˜Kšœœœ2˜@Kšœœ˜Kšœœ˜ Kšœœœœ˜Kšœ œ˜Kšœœœ œ˜7Kšœ œ˜"Kšœ œ˜"K˜šœœœ˜Kšœ˜Kšœ˜—K˜Kšœœœ œE˜bKšœœœœB˜eKšœœœ œE˜dKšœœ ˜KšœœK˜aK˜Kšœœœ<˜]KšœœœB˜jKšœœœ>˜aKšœ˜KšœœE˜[K˜Kšœn˜rKšœl˜pKšœx˜|KšœΉ˜½K˜šœœœ ˜Kšœœ!œ ˜BKš œ œœœœœœ˜+Kšœœœœœ œœœœœœœœ œ!œ ˜ΔKšœ˜—K˜KšœœJœ˜pK˜K˜K˜ Kšœ˜—K˜K˜ K˜Kšœ˜—…— € ν