Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
michaelrsweet opened this issue May 17, 2022 · 1 comment
Assignees
Labels
bug Something isn't working priority-high
Milestone

Comments

@michaelrsweet
Copy link
Member

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.

@michaelrsweet
Copy link
Member Author

[master 8dc3233] Fix handling of EXPECT for finding a single member with a given value (Issue #4)

@github-project-automation github-project-automation bot moved this from To Do to Done in OpenPrinting CUPS 3.0 Jan 19, 2023
michaelrsweet added a commit that referenced this issue Jan 23, 2023
Add ippRestore/ippSave APIs to restore and save the current message position
for ippFind/NextAttribute and ippGetFirst/NextAttribute.

Update documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high
Projects
Development

No branches or pull requests

1 participant