diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2013-06-05 17:25:22 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2013-06-05 17:25:22 +0000 |
commit | 4ffc419764a736cd489c21dd6895b2bf162cbf4e (patch) | |
tree | 281900679f19bd0f0fec31322d726426f00017ae /cups/testpwg.c | |
parent | 766a82295781e5923fda8329c981959b7b77558b (diff) | |
download | cups-4ffc419764a736cd489c21dd6895b2bf162cbf4e.tar.gz |
<rdar://problem/14065748> pwgMediaForPWG: roll_max_36.1025x3622.0472in becomes 91700 x 180568 instead of 91700 x 9199999
Convert fractional portion separately to avoid integer overflow.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11011 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/testpwg.c')
-rw-r--r-- | cups/testpwg.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cups/testpwg.c b/cups/testpwg.c index b3d5cead5..58f6f73e4 100644 --- a/cups/testpwg.c +++ b/cups/testpwg.c @@ -170,6 +170,20 @@ main(int argc, /* I - Number of command-line args */ else puts("PASS"); + fputs("pwgMediaForPWG(\"roll_max_36.1025x3622.0472in\"): ", stdout); + if ((pwgmedia = pwgMediaForPWG("roll_max_36.1025x3622.0472in")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (pwgmedia->width != 91700 || pwgmedia->length != 9199999) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + printf("PASS (%dx%d)\n", pwgmedia->width, pwgmedia->length); + fputs("pwgMediaForLegacy(\"na-letter\"): ", stdout); if ((pwgmedia = pwgMediaForLegacy("na-letter")) == NULL) { |