Skip to content

ipptool: Test will fail when EXPECT directive is seeking a value for a 1setOf that isn't the first in the set #4

@michaelrsweet

Description

@michaelrsweet

From @wifiprintguy in ippsample issue 253:

A Get-Printer-Attributes test that examines the contents of an attribute that is of type 1setOf collection will fail if the first instance of that collection doesn't contain a matching member value. For instance, an ippserver configuration (.conf) file that contains this:

ATTR collection     finishings-col-database
{
 MEMBER keyword finishing-template                 'bale'
 MEMBER rangeOfInteger media-sheets-supported      1-150
 MEMBER collection baling
{
   MEMBER keyword baling-type                      'band'
   MEMBER keyword baling-when                      'after-sets'
 }
},
{
  MEMBER keyword finishing-template                 'bind'
  MEMBER rangeOfInteger media-sheets-supported      1-150
  MEMBER collection binding
  {
    MEMBER keyword binding-type                     'spiral'
    MEMBER keyword binding-reference-edge           'left'
  }
}

A .test file with this will fail to find 'bind', but will find 'bind' if the collections are reordered so that 'bale' is second and 'bind' is first:

#####################################
# BALING
#####################################
{
    SKIP-IF-NOT-DEFINED HAVE_BALING

    NAME '[BALING-1] Check finishings-col members support for baling'

    OPERATION Get-Printer-Attributes

    GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
        ATTR uri printer-uri $uri
        ATTR keyword requested-attributes 'finishings-col-database'

    STATUS successful-ok

    EXPECT finishings-col-database/finishing-template OF-TYPE keyword WITH-VALUE 'bale'
}

{
    SKIP-IF-NOT-DEFINED HAVE_BINDING

    NAME '[BINDING-1] Check finishings-col members support for binding'

    OPERATION Get-Printer-Attributes

    GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
        ATTR uri printer-uri $uri
        ATTR keyword requested-attributes 'finishings-col-database'

    STATUS successful-ok

    EXPECT finishings-col-database/finishing-template OF-TYPE keyword WITH-VALUE 'bind'
}

My only conclusion is that ipptool isn't doing a full traversal / search of all collections in the 1setOf, but is instead looking at only the first collection. Please fix this as it is preventing my Finishings 3.0 prototyping work to proceed.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions