<< XMesaCmplr12f tests z.NEW of pointers to various type of sequences. The first section checks that the length is set correctly on all except the COMPUTED sequence. The second section assigns values to all elements of each sequence and then checks by reading back out. >> DIRECTORY RunRegressions, XMesaCmplr12Defs3, XMesaProcs, OSOps; XMesaCmplr12f: PROGRAM IMPORTS RunRegressions, XMesaCmplr12Defs3, XMesaProcs, OSOps = BEGIN XMesaCall12f: PROCEDURE = { XMesaCmplr12Defs3.z _ OSOps.GetSystemUZone[]; XMesaCmplr12Defs3.card _ 4; XMesaCmplr12Defs3.p1Card _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T1[XMesaCmplr12Defs3.card]]; XMesaCmplr12Defs3.p1Expr _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T1[XMesaCmplr12Defs3.card*5/10+2]]; XMesaCmplr12Defs3.p1Digs _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T1[4]]; XMesaCmplr12Defs3.p2Card _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T2[XMesaCmplr12Defs3.card]]; XMesaCmplr12Defs3.p2Expr _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T2[XMesaCmplr12Defs3.card*5/10+2]]; XMesaCmplr12Defs3.p2Digs _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T2[4]]; XMesaCmplr12Defs3.p3Card _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T3[XMesaCmplr12Defs3.card]]; XMesaCmplr12Defs3.p3Expr _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T3[XMesaCmplr12Defs3.card*5/10+2]]; XMesaCmplr12Defs3.p3Digs _ XMesaCmplr12Defs3.z.NEW[XMesaCmplr12Defs3.T3[4]]; XMesaCmplr12Defs3.sCard _ XMesaCmplr12Defs3.z.NEW[StringBody[XMesaCmplr12Defs3.card]]; XMesaCmplr12Defs3.sExpr _ XMesaCmplr12Defs3.z.NEW[StringBody[XMesaCmplr12Defs3.card*5/10+2]]; XMesaCmplr12Defs3.sDigs _ XMesaCmplr12Defs3.z.NEW[StringBody[4]]; XMesaProcs.PrintCR[]; XMesaProcs.PrintS["ModF 400's compiler tests."]; XMesaProcs.PrintCR[]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p1Card.length,XMesaCmplr12Defs3.card,401,"allocation length check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p1Expr.length,XMesaCmplr12Defs3.card*5/10+2,402,"allocation length check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p1Digs.length,4,403,"allocation length check"]; << cannot check the length of a computed sequence by definition >> XMesaProcs.Isequal[XMesaCmplr12Defs3.p3Card.length,XMesaCmplr12Defs3.card,421,"allocation length check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p3Expr.length,XMesaCmplr12Defs3.card*5/10+2,422,"allocation length check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p3Digs.length,4,423,"allocation length check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.sCard.maxlength,XMesaCmplr12Defs3.card,451,"allocation maxlength check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.sExpr.maxlength,XMesaCmplr12Defs3.card*5/10+2,452,"allocation maxlength check"]; XMesaProcs.Isequal[XMesaCmplr12Defs3.sDigs.maxlength,4,453,"allocation maxlength check"]; XMesaProcs.PrintS["Done."]; XMesaProcs.PrintCR[]; XMesaProcs.PrintS["ModF 500's compiler tests."]; XMesaProcs.PrintCR[]; FOR i: CARDINAL IN [0..XMesaCmplr12Defs3.p1Card.length) DO --all have length 4 XMesaCmplr12Defs3.p1Card[i] _ 3; XMesaCmplr12Defs3.p2Card[i] _ 3; XMesaCmplr12Defs3.p3Card[i] _ 3; XMesaCmplr12Defs3.p1Expr[i] _ 3; XMesaCmplr12Defs3.p2Expr[i] _ 3; XMesaCmplr12Defs3.p3Expr[i] _ 3; XMesaCmplr12Defs3.p1Digs[i] _ 3; XMesaCmplr12Defs3.p2Digs[i] _ 3; XMesaCmplr12Defs3.p3Digs[i] _ 3; XMesaCmplr12Defs3.sCard[i] _ '3; XMesaCmplr12Defs3.sExpr[i] _ '3; XMesaCmplr12Defs3.sDigs[i] _ '3; XMesaProcs.Isequal[XMesaCmplr12Defs3.p1Card[i],3,500+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p2Card[i],3,505+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p3Card[i],3,510+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p1Expr[i],3,515+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p2Expr[i],3,520+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p3Expr[i],3,525+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p1Digs[i],3,530+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p2Digs[i],3,535+i,"INT Sequence Read."]; XMesaProcs.Isequal[XMesaCmplr12Defs3.p3Digs[i],3,540+i,"INT Sequence Read."]; XMesaProcs.Ischarequal[XMesaCmplr12Defs3.sCard[i],'3,545+i,"STRING Sequence Read."]; XMesaProcs.Ischarequal[XMesaCmplr12Defs3.sExpr[i],'3,550+i,"STRING Sequence Read."]; XMesaProcs.Ischarequal[XMesaCmplr12Defs3.sDigs[i],'3,555+i,"STRING Sequence Read."]; ENDLOOP; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p1Card]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p1Expr]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p1Digs]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p2Card]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p2Expr]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p2Digs]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p3Card]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p3Expr]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.p3Digs]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.sCard]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.sExpr]; XMesaCmplr12Defs3.z.FREE[@XMesaCmplr12Defs3.sDigs]; XMesaProcs.PrintS["Done."]; }; RunRegressions.RegisterTest[XMesaCall12f, "test12"]; END. ® XMesaCmplr12f.mesa 20-Aug-87 15:44:19 Jim Foote January 20, 1988 10:20:15 am PST Mna, April 17, 1991 3:29 pm PDT write to sequences and then read to check. mainline Ê•NewlineDelimiter ™J™&J™*J™J˜J˜’J˜šÏk ˜ J˜J˜J˜ J˜J˜—šÏn œ˜Jšœ7˜>—š˜Jšž œ œ˜J˜-J˜J˜Jšœ/œœ˜aJšœ/œœ!˜hJšœ/œœ˜LJšœ/œœ˜aJšœ/œœ!˜hJšœ/œœ˜LJšœ/œœ˜aJšœ/œœ!˜hJšœ/œœ˜LJ˜Jšœ.œ%˜VJšœ.œ,˜]Jšœ.œ˜AJ˜J˜J˜0J˜J˜J˜iJ˜pJ˜TJ˜J˜BJ˜J˜iJ˜pJ˜TJ˜J˜nJ˜uJ˜YJ˜J˜J˜J˜0J˜J˜J˜™*Jš œœœ&œÏc˜NJ˜ J˜ J˜ J˜ J˜ J˜ J˜ J˜ J˜ J˜ J˜ J˜ J˜J˜MJ˜MJ˜MJ˜MJ˜MJ˜MJ˜MJ˜MJ˜MJ˜TJ˜TJ˜TJ˜—Jšœ˜J˜Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜4Jšœœ˜3Jšœœ˜3Jšœœ˜3J˜J˜J˜J˜J˜J™J˜4J˜—Jšœ˜—…—”ß