Fix PS test crash

When the tests run ghostscipt on ps2 files it crashes with:

  Error: /undefined in .setlanguagelevel
  Operand stack:
     2
  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
  Dictionary stack:
     --dict:732/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
  Current allocation mode is local
  GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1

The problem is the "-c 2 .setlanguagelevel -f" on the gs command line
to set ghostscript to language level 2. I'm not sure why this no longer works.

.setlanguagelevel is not mentioned any where in the gs custom operators listed in
https://www.ghostscript.com/doc/current/Language.htm

I assume this operator was meant for ghostscript internal use and
is no longer exposed in recent versions. Remove it from the test.
This commit is contained in:
Adrian Johnson 2021-07-16 13:06:02 +09:30
parent 26043a2db1
commit e73b4c799e

View file

@ -226,9 +226,8 @@ _cairo_boilerplate_ps_surface_write_to_png (cairo_surface_t *surface,
char command[4096]; char command[4096];
int exitstatus; int exitstatus;
sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s %s", sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s",
ptc->width, ptc->height, filename, ptc->width, ptc->height, filename,
ptc->level == CAIRO_PS_LEVEL_2 ? "-c 2 .setlanguagelevel -f" : "",
ptc->filename); ptc->filename);
exitstatus = system (command); exitstatus = system (command);
#if _XOPEN_SOURCE && HAVE_SIGNAL_H #if _XOPEN_SOURCE && HAVE_SIGNAL_H