Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

RT 98574 - content.t testing upgrades

  • 0 Replies

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 823
    • View Profile
RT 98574 - content.t testing upgrades
« October 21, 2016, 01:31:32 PM »
Subject:    content.t testing upgrades
Date:    Tue, 2 Sep 2014 21:20:08 -0400
To:    bug-PDF-API2 [...]

PDF::API2  v2.022  Perl 5.16.3  Windows 7  Severity: Normal

There were many missing installation tests in content.t, for

  • Added tests for rotate(), scale(), skew(), transform(), transform_rel(), matrix(), save(), restore(), strokecolor(named, RGB), inewidth(),
    miterlimit(), rect(), rectxy(), pie(), hspace(), hscale(), fill(), fillstroke(), clip(), charspace(), wordspace(), lead(), render(), rise(), distance(), cr(), nl()
  • some tests will likely have to be updated once fixes are made: nl (see 98535), cr (see 98550), flatness (see 98539)
  • remove superfluous test cases (not exercising different code paths): flatness(), linecap(), linejoin()
  • still untested: font(), textstate()
  • documented, but can these be tested in content.t? shade(), egstate(), image(), formimage(), textpos(), text(), advancewidth(), text_justified(), text_fill_left(), text_fill_center(), text_fill_right(), text_fill_justified()
  • undocumented: textlabel(), paragraph(), section()
  • need to test many color inputs:
    • fillcolor() and strokecolor()
    • RGB spec with 1, 3, 4 hex digits per primitive
    • HSV spec with 1, 2, 3, 4 hex digits per primitive
    • CMYK spec with 1, 2, 4 hex digits per primitive
    • HSL spec with ? digits
    • L*a*b spec with ? digits
    • pattern and shading space
    • legacy gray color
    • indexed colorspace
    • legacy RGB
    • legacy CMYK
Note that the fillcolor() test includes a 9 digit CMYK (% format) value. Is this an error, or is it really CMY? We need to better
document in the POD how the wrong number of digits are to be handled, and test these in content.t.

I have submitted an updated content.t to the maintainer.
Wed Feb 17 18:29:37 2016 steve [...] - Correspondence added

If you still have this file, would you attach it to this ticket, please?
Wed Feb 17 18:29:38 2016 The RT System itself - Status changed from 'new' to 'open'
Subject:    [ #98574]
Date:    Thu, 18 Feb 2016 16:12:04 -0500
To:    bug-PDF-API2 [...]
From:    Phil M Perry

I still have it. Let me review it to see if there's anything in there dependent on bug fixes (tickets) that I submitted but have not yet been accepted, or anything covered in an existing patch I've already sent. I will have to look at nl() and cr(), as well as miterlimit() and hscale(), which you may already have. The three developer's methods can come out if they're still in there. I'll have to look at the bogus CMYK color definition. Maybe this submission should wait until all my Content-related bug tickets have been resolved?
Subject:    [ #98574]
Date:    Fri, 19 Feb 2016 19:59:19 -0500
To:    bug-PDF-API2 [...]
From:    Phil M Perry

| If you still have this file, would you attach it to this ticket, please?

Done. It adds all the tests mentioned in the first bullet, except those already in (per recent patches): hscale() and miterlimit(). The deprecated names are still tested. I removed the nl(width) test, as you have removed that (bullet 2). Any further code changes in nl() and cr() will necessitate an update to content.t. I took out 3 redundant tests in bullet 3 (they did not exercise different code paths).

strokecolor() and fillcolor() tests for CMYK had invalid inputs that were not caught in the code. I changed %fff000000 to %ff000000, which is 4 8-bit values. With the extra digit, it just happened to evaluate correctly to 1 0 0 0 (grouped as fff 000 000 0 rather than ff 00 00 00). The tests were also mislabeled as CMY rather than CMYK (presumably the test author was confused and thought they were testing CMY). No code changes were needed, just the inputs from content.t. Perhaps we should do some input validation (count of digits and digit values) in the code?

I haven't done anything about tests for bullets 4, 5, and 7. Bullet 6 is 3 "developer routines" that presumably will soon be removed from into some other module. Bullet 7 is detailed color specification testing that should be added at some point.

Fri Oct 07 15:15:07 2016 steve [...] - Correspondence added

Applied with the following changes:

- The test for pie() failed.  I pulled it out so that everything else could be applied.

- The transform_rel test was matching the wrong part of the PDF, so I extended it (and did the same for transform).

- Removed test numbers from the comments so that adding future tests doesn't require renumbering everything.

- Updated some comment names for clarity.
Fri Oct 07 15:15:08 2016 steve [...] - Status changed from 'open' to 'patched'
Mon Oct 10 09:22:39 2016 steve [...] - Status changed from 'patched' to 'resolved'
Mon Oct 10 09:22:45 2016 steve [...] - Fixed in 2.029 added