From: mike Date: Mon, 3 Oct 2011 20:21:47 +0000 (+0000) Subject: Add no-value to media-default and orientation-requested-default tests. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfa73c5acf52bb53fbdee7c0423c328fa9e8b63b;p=thirdparty%2Fcups.git Add no-value to media-default and orientation-requested-default tests. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10043 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-IPPTOOL.txt b/CHANGES-IPPTOOL.txt index 6f60acc88a..aad45c12cd 100644 --- a/CHANGES-IPPTOOL.txt +++ b/CHANGES-IPPTOOL.txt @@ -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 diff --git a/test/ipp-1.1.test b/test/ipp-1.1.test index a3e3b30f88..2708258dfc 100644 --- a/test/ipp-1.1.test +++ b/test/ipp-1.1.test @@ -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 diff --git a/test/ipp-2.0.test b/test/ipp-2.0.test index dd3e35cdab..9240da1bb6 100644 --- a/test/ipp-2.0.test +++ b/test/ipp-2.0.test @@ -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 diff --git a/test/ipptool.c b/test/ipptool.c index f75aadc026..bd5c75f918 100644 --- a/test/ipptool.c +++ b/test/ipptool.c @@ -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) { /*