]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The ipptool program now supports collection attributes with multiple values
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 8 Apr 2014 20:42:50 +0000 (20:42 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 8 Apr 2014 20:42:50 +0000 (20:42 +0000)
(<rdar://problem/15355124>)

Add a test file for FaxOut.

Update the get_token function to allow {, }, and "," to be values of their own.

Update the collection code to allow multiple top-level collection values (still
no support for embedding member attributes with multiple collection values,
however we don't need to test that right now...)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11802 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
test/fax-job.test [new file with mode: 0644]
test/ipptool.c
xcode/CUPS.xcodeproj/project.pbxproj

index 5566eb52352146aaffccdbc98862772ae4694c9f..50fa52372c791e6f595c76d7107438c9f44cc690 100644 (file)
@@ -11,6 +11,8 @@ CHANGES IN CUPS V2.0b1
        - Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
        - Dropped lppasswd and support for Digest authentication in in the
          scheduler (STR #4321)
+       - The ipptool program now supports collection attributes with multiple
+         values (<rdar://problem/15355124>)
        - The sample drivers now include all of the installed localizations by
          default (<rdar://problem/14756625>)
        - Adopted Linux man page conventions and updated all man pages
diff --git a/test/fax-job.test b/test/fax-job.test
new file mode 100644 (file)
index 0000000..dd35532
--- /dev/null
@@ -0,0 +1,59 @@
+# Fax a test page using Create-Job + Send-Document
+#
+# Usage:
+#
+#    ./ipptest -f filename ipp://... fax-job.test
+{
+       # The name of the test...
+       NAME "Create FaxOut Job for 555-1212 and an IPP destination"
+
+       # The operation to use
+       OPERATION Create-Job
+
+       # Attributes, starting in the operation group...
+       GROUP operation-attributes-tag
+       ATTR charset attributes-charset utf-8
+       ATTR language attributes-natural-language en
+       ATTR uri printer-uri $uri
+       ATTR name requesting-user-name $user
+
+       GROUP job-attributes-tag
+       ATTR collection destination-uris {
+               MEMBER uri destination-uri tel:4055551212
+       },{
+               MEMBER uri destination-uri ipp://11.22.33.44/ipp/print
+               MEMBER enum print-quality 5
+               MEMBER keyword media na_letter_8.5x11in
+       }
+
+       # What statuses are OK?
+       STATUS successful-ok
+       STATUS successful-ok-ignored-or-substituted-attributes
+
+       # What attributes do we expect?
+       EXPECT job-id OF-TYPE integer WITH-VALUE >0
+       EXPECT job-uri OF-TYPE uri
+}
+{
+       # The name of the test...
+       NAME "Send FaxOut Document"
+
+       # The operation to use
+       OPERATION Send-Document
+
+       # Attributes, starting in the operation group...
+       GROUP operation-attributes-tag
+       ATTR charset attributes-charset utf-8
+       ATTR language attributes-natural-language en
+       ATTR uri printer-uri $uri
+       ATTR integer job-id $job-id
+       ATTR name requesting-user-name $user
+       ATTR mimetype document-format $filetype
+       ATTR boolean last-document true
+
+       FILE $filename
+
+       # What statuses are OK?
+       STATUS successful-ok
+       STATUS successful-ok-ignored-or-substituted-attributes
+}
index 1fce1d865892cdf616e577a843071d9717915b81..f3009b42fa0257f80dc823925577cb9d84782b08 100644 (file)
@@ -1787,6 +1787,36 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
                pass = 0;
                goto test_exit;
              }
+
+             do
+             {
+               ipp_t   *col;                   /* Collection value */
+               long    pos = ftell(fp);        /* Save position of file */
+
+               if (!get_token(fp, token, sizeof(token), &linenum))
+                 break;
+
+               if (strcmp(token, ","))
+               {
+                 fseek(fp, pos, SEEK_SET);
+                 break;
+               }
+
+               if (!get_token(fp, token, sizeof(token), &linenum) || strcmp(token, "{"))
+               {
+                 print_fatal_error("Unexpected \"%s\" on line %d.", token, linenum);
+                 pass = 0;
+                 goto test_exit;
+                 break;
+               }
+
+               if ((col = get_collection(vars, fp, &linenum)) == NULL)
+                 break;
+
+               ippSetCollection(request, &attrptr, ippGetCount(attrptr), col);
+               lastcol = attrptr;
+             }
+             while (!strcmp(token, "{"));
              break;
 
           case IPP_TAG_STRING :
@@ -3816,6 +3846,13 @@ get_token(FILE *fp,                      /* I  - File to read from */
 
       (*linenum) ++;
     }
+    else if (ch == '{' || ch == '}' || ch == ',')
+    {
+      buf[0] = (char)ch;
+      buf[1] = '\0';
+
+      return (buf);
+    }
     else
     {
      /*
index 8db819c8c97e1d672ba6498ce10be8f479e2c7f1..7258788703bf7ac49cf02bc6671d0d36ae2c8edf 100644 (file)
                278C58EA136B64B000836530 /* Kerberos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E6136B64B000836530 /* Kerberos.framework */; };
                278C58EB136B64B000836530 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E7136B64B000836530 /* Security.framework */; };
                278C58EC136B64B000836530 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E8136B64B000836530 /* SystemConfiguration.framework */; };
+               7200511218F492F200E7B81B /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E5136B64AF00836530 /* CoreFoundation.framework */; };
                720DD6CD1358FD720064AA82 /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72220EAE1333047D00FCA411 /* libcups.dylib */; };
                720DD6D31358FDDE0064AA82 /* snmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 720DD6D21358FDDE0064AA82 /* snmp.c */; };
                720DD6D413590AB90064AA82 /* ieee1284.c in Sources */ = {isa = PBXBuildFile; fileRef = 724379CA1334000E009631B9 /* ieee1284.c */; };
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               7200511218F492F200E7B81B /* CoreFoundation.framework in Frameworks */,
                                274FF6231333321400317ECB /* libcups.dylib in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;