]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
<rdar://problem/13876038> cups.org: ipptool does not include any version information...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 13 May 2013 19:40:47 +0000 (19:40 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 13 May 2013 19:40:47 +0000 (19:40 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10981 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
doc/help/man-ipptoolfile.html
man/ipptoolfile.man
test/ipptool.c

index d05d8c820ef489a075c96ce254e0aebfb0eac454..a282705eb8446cdd0f2dcaa47adf4d571951b836 100644 (file)
@@ -5,6 +5,8 @@ CHANGES IN CUPS V1.7b2
 
        - The ipptool program did not continue past include file errors by
          default (<rdar://problem/13875803>)
+       - The ipptool program now supports FILE-ID and TEST-ID directives and
+         includes their values in its XML output (<rdar://problem/13876038>)
 
 
 CHANGES IN CUPS V1.7b1
index 4441d9d7595ca4b27de84e0b4420a51b4e8713ab..e0be2dcbe39a225a33db1b8f644e5cc872849e88 100644 (file)
@@ -76,6 +76,10 @@ The following directives can be used outside of a test:
 <dd>Defines the named variable to the given value if it does not already have a
 value.
 </dd>
+<dt>FILE-ID "identifier"
+</dt>
+<dd>Specifies an identifier string for the current file.
+</dd>
 <dt>IGNORE-ERRORS yes
 </dt>
 <dd></dd>
@@ -271,6 +275,10 @@ resulted in an error/failure.
 added as predicates - see the "STATUS PREDICATES" section for more information
 on predicates.
 </dd>
+<dt>TEST-ID "identifier"
+</dt>
+<dd>Specifies an identifier string for the current test.
+</dd>
 <dt>TRANSFER auto
 </dt>
 <dd>Specifies that this test will use "Transfer-Encoding: chunked" if it has an
index 2049cbde0d6cc6c4481fba68c869c6346e7cb4f1..785e204bb9db4da728b2c915008a57ffb9be7761 100644 (file)
@@ -78,6 +78,9 @@ DEFINE-DEFAULT variable-name value
 Defines the named variable to the given value if it does not already have a
 value.
 .TP 5
+FILE-ID "identifier"
+Specifies an identifier string for the current file.
+.TP 5
 IGNORE-ERRORS yes
 .TP 5
 IGNORE-ERRORS no
@@ -227,6 +230,9 @@ Specifies an expected response status-code value. Additional requirements can be
 added as predicates - see the "STATUS PREDICATES" section for more information
 on predicates.
 .TP 5
+TEST-ID "identifier"
+Specifies an identifier string for the current test.
+.TP 5
 TRANSFER auto
 Specifies that this test will use "Transfer-Encoding: chunked" if it has an
 attached file or "Content-Length:" otherwise.
index 61fc8ed70edbff2d4dd08470a78a69ed264f5b9c..a5c34c6e2a7911bdda3d8a5e88353749c67f8e4d 100644 (file)
@@ -807,7 +807,9 @@ do_tests(_cups_vars_t *vars,                /* I - Variables */
   ipp_attribute_t *attrptr,            /* Attribute pointer */
                *found,                 /* Found attribute */
                *lastcol = NULL;        /* Last collection attribute */
-  char         name[1024];             /* Name of test */
+  char         name[1024],             /* Name of test */
+               file_id[1024],          /* File identifier */
+               test_id[1024];          /* Test identifier */
   char         filename[1024];         /* Filename */
   _cups_transfer_t transfer;           /* To chunk or not to chunk */
   int          version,                /* IPP version number to use */
@@ -870,6 +872,7 @@ do_tests(_cups_vars_t *vars,                /* I - Variables */
 
   errors     = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup,
                              (cups_afree_func_t)free);
+  file_id[0] = '\0';
   pass       = 1;
   linenum    = 1;
   request_id = (CUPS_RAND() % 1000) * 137 + 1;
@@ -925,6 +928,25 @@ do_tests(_cups_vars_t *vars,               /* I - Variables */
 
       continue;
     }
+    else if (!strcmp(token, "FILE-ID"))
+    {
+     /*
+      * FILE-ID "string"
+      */
+
+      if (get_token(fp, temp, sizeof(temp), &linenum))
+      {
+        expand_variables(vars, file_id, temp, sizeof(file_id));
+      }
+      else
+      {
+        print_fatal_error("Missing FILE-ID value on line %d.", linenum);
+       pass = 0;
+       goto test_exit;
+      }
+
+      continue;
+    }
     else if (!strcmp(token, "IGNORE-ERRORS"))
     {
      /*
@@ -1204,6 +1226,7 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
     filename[0]    = '\0';
     skip_previous  = 0;
     skip_test      = 0;
+    test_id[0]     = '\0';
     version        = Version;
     transfer       = Transfer;
     compression[0] = '\0';
@@ -1487,6 +1510,25 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
 
        continue;
       }
+      else if (!strcmp(token, "TEST-ID"))
+      {
+       /*
+       * TEST-ID "string"
+       */
+
+       if (get_token(fp, temp, sizeof(temp), &linenum))
+       {
+         expand_variables(vars, test_id, temp, sizeof(test_id));
+       }
+       else
+       {
+         print_fatal_error("Missing TEST-ID value on line %d.", linenum);
+         pass = 0;
+         goto test_exit;
+       }
+
+       continue;
+      }
       else if (!strcmp(token, "TRANSFER"))
       {
        /*
@@ -2348,8 +2390,22 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
       puts("<dict>");
       puts("<key>Name</key>");
       print_xml_string("string", name);
+      if (file_id[0])
+      {
+       puts("<key>FileId</key>");
+       print_xml_string("string", file_id);
+      }
+      if (test_id[0])
+      {
+        puts("<key>TestId</key>");
+        print_xml_string("string", test_id);
+      }
+      puts("<key>Version</key>");
+      printf("<string>%d.%d</string>\n", version / 10, version % 10);
       puts("<key>Operation</key>");
       print_xml_string("string", ippOpString(op));
+      puts("<key>RequestId</key>");
+      printf("<integer>%d</integer>\n", request_id);
       puts("<key>RequestAttributes</key>");
       puts("<array>");
       if (request->attrs)
@@ -4406,6 +4462,8 @@ print_xml_header(void)
          "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">");
     puts("<plist version=\"1.0\">");
     puts("<dict>");
+    puts("<key>ipptoolVersion</key>");
+    puts("<string>" CUPS_SVERSION "</string>");
     puts("<key>Transfer</key>");
     printf("<string>%s</string>\n",
            Transfer == _CUPS_TRANSFER_AUTO ? "auto" :