Add ability for ipptool to use variables in the Delay and Operation statements #4175

Closed
michaelrsweet opened this Issue Aug 28, 2012 · 2 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Aug 28, 2012

Version: 1.7-feature
CUPS.org User: quatre

Ipptool does not allow variables in the Delay and Operation statements (probably others as well). It would be helpful if ipptool would support using variables in these areas. That way, instead of hard coding values, they could be placed at the top of a .test file with the DEFINE statement.

Collaborator

michaelrsweet commented Dec 13, 2012

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Dec 13, 2012

"str4175.patch":

Index: test/ipptool.c

--- test/ipptool.c (revision 10756)
+++ test/ipptool.c (working copy)
@@ -1494,13 +1494,15 @@
* Operation...
*/

  • if (!get_token(fp, token, sizeof(token), &linenum))
  • if (!get_token(fp, temp, sizeof(temp), &linenum))
    {
    print_fatal_error("Missing OPERATION code on line %d.", linenum);
    pass = 0;
    goto test_exit;
    }
  • expand_variables(vars, token, temp, sizeof(token));

if ((op = ippOpValue(token)) == (ipp_op_t)-1 &&
(op = strtol(token, NULL, 0)) == 0)
{
@@ -1543,13 +1545,15 @@

 double delay;
  • if (!get_token(fp, token, sizeof(token), &linenum))
  • if (!get_token(fp, temp, sizeof(temp), &linenum))
    {
    print_fatal_error("Missing DELAY value on line %d.", linenum);
    pass = 0;
    goto test_exit;
    }
  • expand_variables(vars, token, temp, sizeof(token));

if ((delay = _cupsStrScand(token, NULL, localeconv())) <= 0.0)
{
print_fatal_error("Bad DELAY value "%s" on line %d.", token,

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment