]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add no-value to media-default and orientation-requested-default tests.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 3 Oct 2011 20:21:47 +0000 (20:21 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 3 Oct 2011 20:21:47 +0000 (20:21 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10043 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-IPPTOOL.txt
test/ipp-1.1.test
test/ipp-2.0.test
test/ipptool.c

index 6f60acc88a3302ac4f5e22882ea574a15fa9cc5b..aad45c12cd49ba165a9cf6bf4012facf8130e2e8 100644 (file)
@@ -1,12 +1,13 @@
-CHANGES-IPPTOOL.txt - 2011-09-30
+CHANGES-IPPTOOL.txt - 2011-10-03
 --------------------------------
 
 This file provides a list of changes to the ipptool binary distribution posted
 on cups.org.
 
 
-2011-09-30
+2011-10-03
 
+       - ipptool now supports no-value + regex checks
        - ipptool now shows an error when an attribute appears more than once
          within the same attribute group.
        - ipptool did not display attributes as specified by the DISPLAY
@@ -17,8 +18,10 @@ on cups.org.
        - Updated the IPP/1.1 tests to properly validate support for
          job-hold-until-default and job-hold-until-supported when the Hold-Job
          operation is supported.
-       - Updated the IPP/1.1 tests to property check for the various standard
+       - Updated the IPP/1.1 tests to properly check for the various standard
          media sizes for the printing tests.
+       - Updated the IPP/1.1 tests to accept "no-value" for media-default an
+         orientation-requested-default.
        - Updated the IPP/2.0 tests to properly validate media-col
          "media-xxx-supported" attributes.
        - Updated the IPP/2.2 tests to properly validate media-ready and
index a3e3b30f88dc597214b64e843a0aa2ae3f256683..2708258dfcd6095792d422ba2edbf33fe902d60d 100644 (file)
@@ -253,7 +253,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT ?job-priority-supported OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0,<101
        EXPECT ?job-sheets-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag
        EXPECT ?job-sheets-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE none
-       EXPECT ?media-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
+       EXPECT ?media-default OF-TYPE no-value|keyword|name IN-GROUP printer-attributes-tag COUNT 1
        EXPECT ?media-ready OF-TYPE keyword|name IN-GROUP printer-attributes-tag
        EXPECT ?media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
        EXPECT ?multiple-document-handling-default OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^(single-document|separate-documents-uncollated-copies|separate-documents-collated-copies|single-document-new-sheet)$$/"
@@ -261,7 +261,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT ?number-up-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
        EXPECT ?number-up-supported OF-TYPE integer|rangeOfInteger IN-GROUP printer-attributes-tag WITH-VALUE >0
        EXPECT ?number-up-supported WITH-VALUE 1
-       EXPECT ?orientation-requested-default OF-TYPE enum,no-value IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE no-value,3,4,5,6
+       EXPECT ?orientation-requested-default OF-TYPE no-value|enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE no-value,3,4,5,6
        EXPECT ?orientation-requested-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5,6
        EXPECT ?pages-ranges-supported OF-TYPE boolean IN-GROUP printer-attributes-tag
        EXPECT ?print-quality-default OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5
index dd3e35cdabd1fcc0ce99f3d88c37940d333ed3f9..9240da1bb65ec43c43f5cdfbd5dec217dbb18087 100644 (file)
@@ -50,10 +50,10 @@ DEFINE MEDIA_REGEX "/^((custom|na|asme|roc|oe)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\
        EXPECT copies-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag
        EXPECT finishings-default OF-TYPE enum IN-GROUP printer-attributes-tag
        EXPECT finishings-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3
-       EXPECT media-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$MEDIA_REGEX"
+       EXPECT media-default OF-TYPE no-value|keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "no-value,$MEDIA_REGEX"
        EXPECT ?media-ready OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE "$MEDIA_REGEX"
        EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE "$MEDIA_REGEX"
-       EXPECT orientation-requested-default OF-TYPE enum,no-value IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE no-value,3,4,5,6
+       EXPECT orientation-requested-default OF-TYPE no-value|enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE no-value,3,4,5,6
        EXPECT orientation-requested-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5,6
        EXPECT output-bin-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
        EXPECT output-bin-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
@@ -93,7 +93,7 @@ DEFINE MEDIA_REGEX "/^((custom|na|asme|roc|oe)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\
        EXPECT media-order-count-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag WITH-VALUE >0 IF-DEFINED HAVE_MEDIA_ORDER_COUNT
        EXPECT media-pre-printed-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_PRE_PRINTED
        EXPECT media-recycled-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_RECYCLED
-       EXPECT media-size-supported OF-TYPE begCollection IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_SIZE
+       EXPECT media-size-supported OF-TYPE collection IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_SIZE
        EXPECT media-tooth-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_TOOTH
        EXPECT media-type-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_TYPE
        EXPECT media-weight-metric-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag WITH-VALUE >-1 IF-DEFINED HAVE_MEDIA_WEIGHT_METRIC
index f75aadc0262e4711836972fe6671ff53a03b7313..bd5c75f918b36eff464c6f1a877e5e7871a3ab29 100644 (file)
@@ -2007,7 +2007,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
 
          tokenptr = token + strlen(token) - 1;
 
-         if (token[0] == '/' && tokenptr > token && *tokenptr == '/')
+         if ((token[0] == '/' || !strncmp(token, "no-value,/", 10)) &&
+             tokenptr > token && *tokenptr == '/')
          {
           /*
            * WITH-VALUE is a POSIX extended regular expression.
@@ -2017,7 +2018,17 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
            last_expect->with_regex = 1;
 
            if (last_expect->with_value)
-             memcpy(last_expect->with_value, token + 1, tokenptr - token - 1);
+           {
+             if (!strncmp(token, "no-value,/", 10))
+             {
+               memcpy(last_expect->with_value, "no-value,", 9);
+               memcpy(last_expect->with_value + 9, token + 10,
+                      tokenptr - token - 10);
+             }
+             else
+               memcpy(last_expect->with_value, token + 1,
+                      tokenptr - token - 1);
+           }
          }
          else
          {
@@ -5326,6 +5337,9 @@ with_value(char            *value,        /* I - Value string */
     case IPP_TAG_TEXTLANG :
     case IPP_TAG_URI :
     case IPP_TAG_URISCHEME :
+       if (!strncmp(value, "no-value,", 9))
+         value += 9;
+
         if (regex)
        {
         /*