1
0

acctest.ps 4.2 KB

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