# Get printer attributes using get-printer-attributes
{
# The name of the test...
- NAME "Get printer attributes using get-printer-attributes"
-
- # The resource to use for the POST
- # RESOURCE /admin
+ NAME "Get printer attributes using Get-Printer-Attributes"
# The operation to use
- OPERATION get-printer-attributes
+ OPERATION Get-Printer-Attributes
# Attributes, starting in the operation group...
- GROUP operation
+ GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $uri
}
break;
+ case IPP_TAG_RANGE :
+ for (i = 0; i < attr->num_values; i ++)
+ {
+ char op, /* Comparison operator */
+ *nextptr; /* Next pointer */
+ int intvalue; /* Integer value */
+
+
+ valptr = value;
+ if (!strncmp(valptr, "no-value,", 9))
+ valptr += 9;
+
+ while (isspace(*valptr & 255) || isdigit(*valptr & 255) ||
+ *valptr == '-' || *valptr == ',' || *valptr == '<' ||
+ *valptr == '=' || *valptr == '>')
+ {
+ op = '=';
+ while (*valptr && !isdigit(*valptr & 255) && *valptr != '-')
+ {
+ if (*valptr == '<' || *valptr == '>' || *valptr == '=')
+ op = *valptr;
+ valptr ++;
+ }
+
+ if (!*valptr)
+ break;
+
+ intvalue = strtol(valptr, &nextptr, 0);
+ if (nextptr == valptr)
+ break;
+ valptr = nextptr;
+
+ switch (op)
+ {
+ case '=' :
+ if (attr->values[i].range.upper == intvalue)
+ return (1);
+ break;
+ case '<' :
+ if (attr->values[i].range.upper < intvalue)
+ return (1);
+ break;
+ case '>' :
+ if (attr->values[i].range.upper > intvalue)
+ return (1);
+ break;
+ }
+ }
+ }
+
+ if (report)
+ {
+ for (i = 0; i < attr->num_values; i ++)
+ print_test_error("GOT: %s=%d-%d", attr->name,
+ attr->values[i].range.lower,
+ attr->values[i].range.upper);
+ }
+ break;
+
case IPP_TAG_BOOLEAN :
for (i = 0; i < attr->num_values; i ++)
{