(cups_afree_func_t)free);
file_id[0] = '\0';
pass = 1;
- linenum = 1;
+ linenum = 0;
request_id = (CUPS_RAND() % 1000) * 137 + 1;
while (!Cancel && get_token(fp, token, sizeof(token), &linenum) != NULL)
attrptr = ippAddIntegers(request, group, value, attr, num_values, values);
}
- if (!tokenptr || *tokenptr)
+ if ((!token[0] || !tokenptr || *tokenptr) && !skip_test)
{
- print_fatal_error(outfile, "Bad %s value \"%s\" on line %d.",
- ippTagString(value), token, linenum);
+ print_fatal_error(outfile, "Bad %s value \'%s\' for \"%s\" on line %d.",
+ ippTagString(value), token, attr, linenum);
pass = 0;
goto test_exit;
}
_cups_strcasecmp(ptr, "dpcm") &&
_cups_strcasecmp(ptr, "other")))
{
- print_fatal_error(outfile, "Bad resolution value \"%s\" on line %d.",
- token, linenum);
+ if (skip_test)
+ break;
+
+ print_fatal_error(outfile, "Bad resolution value \'%s\' for \"%s\" on line %d.", token, attr, linenum);
pass = 0;
goto test_exit;
}
if ((num_vals & 1) || num_vals == 0)
{
- print_fatal_error(outfile, "Bad rangeOfInteger value \"%s\" on line "
- "%d.", token, linenum);
+ if (skip_test)
+ break;
+
+ print_fatal_error(outfile, "Bad rangeOfInteger value \'%s\' for \"%s\" on line %d.", token, attr, linenum);
pass = 0;
goto test_exit;
}
goto test_exit;
}
}
+ else if (skip_test)
+ break;
else
{
- print_fatal_error(outfile, "Bad ATTR collection value on line %d.",
- linenum);
+ print_fatal_error(outfile, "Bad ATTR collection value for \"%s\" on line %d.", attr, linenum);
pass = 0;
goto test_exit;
}
do
{
ipp_t *col; /* Collection value */
- long pos = ftell(fp); /* Save position of file */
+ long savepos = ftell(fp); /* Save position of file */
+ int savelinenum = linenum; /* Save line number */
if (!get_token(fp, token, sizeof(token), &linenum))
break;
if (strcmp(token, ","))
{
- fseek(fp, pos, SEEK_SET);
+ fseek(fp, savepos, SEEK_SET);
+ linenum = savelinenum;
break;
}
break;
default :
- print_fatal_error(outfile, "Unsupported ATTR value tag %s on line %d.",
- ippTagString(value), linenum);
+ print_fatal_error(outfile, "Unsupported ATTR value tag %s for \"%s\" on line %d.", ippTagString(value), attr, linenum);
pass = 0;
goto test_exit;
break;
}
- if (!attrptr)
+ if (!attrptr && !skip_test)
{
- print_fatal_error(outfile, "Unable to add attribute on line %d: %s", linenum,
- cupsLastErrorString());
+ print_fatal_error(outfile, "Unable to add attribute \"%s\" on line %d.", attr, linenum);
pass = 0;
goto test_exit;
}
break;
}
}
+ else
+ {
+ print_fatal_error(outfile, "Unexpected token %s seen on line %d.", token, *linenum);
+ goto col_error;
+ }
}
return (col);