]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/cupstestppd.c
Import CUPS trunk (1.4svn) r7116.
[thirdparty/cups.git] / systemv / cupstestppd.c
index 09a361b99c481b5989650847fdd7963c1b20b930..8e7201f407eb1b9514be4220d9b264fd36277229 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupstestppd.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id: cupstestppd.c 6927 2007-09-07 16:51:00Z mike $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -981,7 +981,8 @@ main(int  argc,                             /* I - Number of command-line args */
          else
            ydpi = xdpi;
 
-         if (xdpi <= 0 || ydpi <= 0 || strcmp(ptr, "dpi"))
+         if (xdpi <= 0 || xdpi > 99999 || ydpi <= 0 || ydpi > 99999 ||
+             strcmp(ptr, "dpi"))
          {
            if (verbose >= 0)
            {
@@ -2052,6 +2053,9 @@ check_translations(ppd_file_t *ppd,       /* I - PPD file */
        continue;
       }
 
+      if (!strcmp(langstart, "en"))
+        continue;
+
       cupsArrayAdd(langlist, langstart);
 
       strlcpy(ll, langstart, sizeof(ll));
@@ -2393,8 +2397,30 @@ test_raster(ppd_file_t *ppd,             /* I - PPD file */
 
     return (0);
   }
-  else
+
+ /*
+  * Try a test of custom page size code, if available...
+  */
+
+  if (!ppdPageSize(ppd, "Custom.612x792"))
     return (1);
+
+  ppdMarkOption(ppd, "PageSize", "Custom.612x792");
+
+  if (cupsRasterInterpretPPD(&header, ppd, 0, NULL, 0))
+  {
+    if (!verbose)
+      _cupsLangPuts(stdout, _(" FAIL\n"));
+
+    if (verbose >= 0)
+      _cupsLangPrintf(stdout,
+                     _("      **FAIL**  Default option code cannot be "
+                       "interpreted: %s\n"), cupsRasterErrorString());
+
+    return (0);
+  }
+
+  return (1);
 }
 
 
@@ -2501,5 +2527,5 @@ valid_utf8(const char *s)         /* I - String to check */
 
 
 /*
- * End of "$Id: cupstestppd.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id: cupstestppd.c 6927 2007-09-07 16:51:00Z mike $".
  */