]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/testppd.c
Import CUPS trunk (1.4svn) r7116.
[thirdparty/cups.git] / cups / testppd.c
index 6fb4fb49c75bfdc9e0806de30ee3ffab9692acdb..e88a125682f6bbc5294a4936a8022024e5e632d5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testppd.c 6676 2007-07-16 17:09:09Z mike $"
+ * "$Id: testppd.c 6936 2007-09-10 18:15:36Z mike $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -61,16 +61,6 @@ static const char    *default_code =
                        "} stopped cleartomark\n";
 
 static const char      *custom_code =
-                       "[{\n"
-                       "%%BeginFeature: *CustomPageSize True\n"
-                       "400\n"
-                       "500\n"
-                       "0\n"
-                       "0\n"
-                       "0\n"
-                       "PageSize=Custom\n"
-                       "%%EndFeature\n"
-                       "} stopped cleartomark\n"
                        "[{\n"
                        "%%BeginFeature: *InputSlot Tray\n"
                        "InputSlot=Tray\n"
@@ -83,6 +73,16 @@ static const char    *custom_code =
                        "[{\n"
                        "%%BeginFeature: *StringOption None\n"
                        "%%EndFeature\n"
+                       "} stopped cleartomark\n"
+                       "[{\n"
+                       "%%BeginFeature: *CustomPageSize True\n"
+                       "400\n"
+                       "500\n"
+                       "0\n"
+                       "0\n"
+                       "0\n"
+                       "PageSize=Custom\n"
+                       "%%EndFeature\n"
                        "} stopped cleartomark\n";
 
 
@@ -224,7 +224,17 @@ main(int  argc,                            /* I - Number of command-line arguments */
       printf("FAIL (\"%s\" instead of \"La Long Foo Reason\")\n", buffer);
     }
 
-    ppdClose(ppd);
+    putenv("LANG=zh_TW");
+
+    fputs("ppdLocalizeIPPReason(zh_TW text): ", stdout);
+    if (ppdLocalizeIPPReason(ppd, "foo", NULL, buffer, sizeof(buffer)) &&
+        !strcmp(buffer, "Number 1 Foo Reason"))
+      puts("PASS");
+    else
+    {
+      status ++;
+      printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer);
+    }
   }
   else
   {
@@ -350,15 +360,27 @@ main(int  argc,                           /* I - Number of command-line arguments */
           attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs))
         printf("    *%s %s/%s: \"%s\"\n", attr->name, attr->spec,
               attr->text, attr->value ? attr->value : "");
-
-      ppdClose(ppd);
     }
   }
 
+#ifdef __APPLE__
+  if (getenv("MallocStackLogging") && getenv("MallocStackLoggingNoCompact"))
+  {
+    char       command[1024];          /* malloc_history command */
+
+    snprintf(command, sizeof(command), "malloc_history %d -all_by_size",
+            getpid());
+    fflush(stdout);
+    system(command);
+  }
+#endif /* __APPLE__ */
+
+  ppdClose(ppd);
+
   return (status);
 }
 
 
 /*
- * End of "$Id: testppd.c 6676 2007-07-16 17:09:09Z mike $".
+ * End of "$Id: testppd.c 6936 2007-09-10 18:15:36Z mike $".
  */