]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/cupstestppd.c
Merge changes from CUPS 1.4svn-r8196 (CUPS 1.4b2)
[thirdparty/cups.git] / systemv / cupstestppd.c
index 0cb42b564bf3cac0dc4945c43ae58ba4e2f1c4af..855c17fbff7d9353cf871a70ffe8a1dd78e140be 100644 (file)
@@ -514,9 +514,28 @@ main(int  argc,                            /* I - Number of command-line args */
          }
        }
 
-      if (ppdFindAttr(ppd, "FileVersion", NULL) != NULL)
+      if ((attr = ppdFindAttr(ppd, "FileVersion", NULL)) != NULL)
       {
-       if (verbose > 0)
+        for (ptr = attr->value; *ptr; ptr ++)
+         if (!isdigit(*ptr & 255) && *ptr != '.')
+           break;
+
+       if (*ptr)
+       {
+         if (verbose >= 0)
+         {
+           if (!errors && !verbose)
+             _cupsLangPuts(stdout, _(" FAIL\n"));
+
+           _cupsLangPrintf(stdout,
+                           _("      **FAIL**  Bad FileVersion \"%s\"\n"
+                             "                REF: Page 56, section 5.3.\n"),
+                           attr->value);
+         }
+
+         errors ++;
+       }
+       else if (verbose > 0)
          _cupsLangPuts(stdout, _("        PASS    FileVersion\n"));
       }
       else
@@ -534,9 +553,33 @@ main(int  argc,                            /* I - Number of command-line args */
        errors ++;
       }
 
-      if (ppdFindAttr(ppd, "FormatVersion", NULL) != NULL)
+      if ((attr = ppdFindAttr(ppd, "FormatVersion", NULL)) != NULL)
       {
-       if (verbose > 0)
+        ptr = attr->value;
+       if (*ptr == '4' && ptr[1] == '.')
+       {
+         
+         for (ptr += 2; *ptr; ptr ++)
+           if (!isdigit(*ptr & 255))
+             break;
+        }
+
+       if (*ptr)
+       {
+         if (verbose >= 0)
+         {
+           if (!errors && !verbose)
+             _cupsLangPuts(stdout, _(" FAIL\n"));
+
+           _cupsLangPrintf(stdout,
+                           _("      **FAIL**  Bad FormatVersion \"%s\"\n"
+                             "                REF: Page 56, section 5.3.\n"),
+                           attr->value);
+         }
+
+         errors ++;
+       }
+       else if (verbose > 0)
          _cupsLangPuts(stdout, _("        PASS    FormatVersion\n"));
       }
       else