home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / gs403osk.tgz / gs403osk.tar / acctest.ps next >
Text File  |  1996-10-21  |  5KB  |  100 lines

  1. %!
  2. % Check that operators do their access tests correctly.
  3.  
  4. % proc dotest => .
  5. /dotest
  6.   {
  7.     dup
  8.     mark
  9.     exch
  10.     stopped not % False if error, true if no error.
  11.     { (Allowed access: ) print cleartomark == }
  12.     if
  13.     clear
  14.   }
  15. def
  16.  
  17. 0 0 moveto % So the show commands don't bomb because of nocurrentpoint.
  18.  
  19. { [1 2] executeonly aload }                 dotest 
  20. { (string) executeonly (seek) anchorsearch }            dotest
  21. { (string) (seek) executeonly anchorsearch }            dotest
  22. { 100 101 (string) noaccess ashow}              dotest
  23. { 100 1 array readonly astore }                 dotest
  24. { 100 101 102 103 104 (string) noaccess awidthshow }        dotest
  25. { 1 dict noacess begin }                    dotest
  26. { 1 array executeonly 1 array copy }                dotest
  27. { 1 array 1 array readonly copy }               dotest
  28. { 1 dict noaccess 1 dict copy }                 dotest
  29. { 1 dict 1 dict readonly copy }                 dotest
  30. { 1 string executeonly 1 string copy }              dotest
  31. { 1 string 1 string readonly copy }             dotest
  32. { (100) executeonly cvi }                   dotest
  33. { (string) executeonly cvn }                    dotest
  34. { (100.001) executeonly cvr }                   dotest
  35. { 1 10 1 string readonly cvrs }                 dotest
  36. { true 5 string readonly cvs }                  dotest
  37. { 1 dict readonly begin /foo true def }             dotest
  38. { 10 array readonly dictstack }                 dotest 
  39. { 1 string executeonly 1 string eq }                dotest
  40. { 1 string 1 string executeonly eq }                dotest
  41. { 10 array readonly execstack }                 dotest
  42. { 1 string noaccess executeonly }               dotest
  43. { 1 array noaccess executeonly }                dotest
  44. { 1 array executeonly { pop } forall }              dotest
  45. { 1 dict noaccess { pop pop } forall }              dotest
  46. { 1 string executeonly { pop } forall }             dotest
  47. { (string1) executeonly (string2) ge }              dotest
  48. { (string1) (string2) executeonly ge }              dotest
  49. { 1 array executeonly 0 get }                   dotest
  50. { 1 dict noaccess /key get }                    dotest
  51. { 1 string executeonly 0 get }                  dotest
  52. { 1 array executeonly 0 1 getinterval }             dotest
  53. { 1 string executeonly 0 1 getinterval }            dotest
  54. { (string1) executeonly (string2) gt }              dotest
  55. { (string1) (string2) executeonly gt }              dotest
  56. { 1 dict noaccess /key known }                  dotest
  57. { {} (string) executeonly kshow }               dotest
  58. { (string1) executeonly (string2) le }              dotest
  59. { (string1) (string2) executeonly le }              dotest
  60. { 1 array executeonly length }                  dotest
  61. { 1 dict noaccess length }                  dotest
  62. { 1 string executeonly length }                 dotest
  63. %%{ /foo 1 dict def foo begin /bar foo def bar noaccess pop /key load } dotest
  64. { (string1) executeonly (string2) lt }              dotest
  65. { (string1) (string2) executeonly lt }              dotest
  66. { 1 dict noaccess maxlength }                   dotest
  67. { 1 string executeonly 1 string ne }                dotest
  68. { 1 string 1 string executeonly ne }                dotest
  69. %{ newpath 0 0 moveto (a) false charpath 
  70. %  {} {} {} {} pathforall closepath }               dotest
  71. { 1 array executeonly 0 put }                   dotest
  72. { 1 dict noaccess /key put }                    dotest
  73. { 1 string executeonly 0 put }                  dotest
  74. { 1 array executeonly 0 1 putinterval }             dotest
  75. { 1 string executeonly 0 1 putinterval }            dotest
  76. { (access.ps) (r) file executeonly read }           dotest
  77. { (access.ps) (r) file executeonly 10 string readhexstring }    dotest
  78. { (access.ps) (r) file 10 string readonly readhexstring }   dotest
  79. { (access.ps) (r) file executeonly 100 string readline }    dotest
  80. { (access.ps) (r) file 100 string readonly readline }       dotest
  81. { (access.ps) (r) file executeonly 10 string readstring }   dotest
  82. { (access.ps) (r) file 10 string readonly readstring }      dotest
  83. % run does not check for no read access?
  84. { (string) executeonly (seek) search }              dotest
  85. { (string) (seek) executeonly search }              dotest
  86. { (string) executeonly show }
  87. %% some test for store.
  88. { (string) executeonly stringwidth }                dotest
  89. { (access.ps) (r) file executeonly token }          dotest
  90. { (10) executeonly token }                  dotest
  91. { /foo 1 dict def foo begin /bar foo def bar noaccess pop /key where } dotest
  92. { 100 101 102 (string) noaccess widthshow }         dotest
  93. { (/tmp/_.ps) noaccess (w) file closefile }         dotest
  94. { (/tmp/_.ps) (w) noaccess file closefile }         dotest
  95. { (/tmp/_.ps) (w) file executeonly 100 write }          dotest
  96. { (/tmp/_.ps) (w) file executeonly 10 string writehexstring }   dotest
  97. { (/tmp/_.ps) (w) file 10 string executeonly writehexstring }   dotest
  98. { (/tmp/_.ps) (w) file executeonly 10 string writestring }  dotest
  99. { (/tmp/_.ps) (w) file 10 string executeonly writestring }  dotest
  100.