-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
From @wifiprintguy, ippsample issue 254:
It would be very useful if the IF-DEFINED and IF-NOT-DEFINED predicates could be used in EXPECT and MEMBER directives so that attributes could be conditionally included in a request. For instance:
{
SKIP-IF-NOT-DEFINED HAVE_BALING
NAME '[BALING-2] Print requesting baling using finishings'
OPERATION Print-Job
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
ATTR mimeMediaType document-format $filetype
GROUP job-attributes-tag
ATTR integer copies 1
ATTR enum finishings 12 # bale
ATTR integer job-pages-per-set 3 IF-DEFINED HAS_JOB_PAGES_PER_SET
ATTR integer copies 2 IF-NOT-DEFINED HAS_JOB_PAGES_PER_SET
FILE $filename
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag WITH-VALUE >0 COUNT 1
EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
}
These two lines:
ATTR integer job-pages-per-set 3 IF-DEFINED HAS_JOB_PAGES_PER_SET
ATTR integer copies 2 IF-NOT-DEFINED HAS_JOB_PAGES_PER_SET
are currently illegal. To achieve this you have to write 2+ tests that are nearly identical, which is not an optimal solution.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done