Show
Ignore:
Timestamp:
09/11/06 23:15:11 (18 years ago)
Author:
jerome
Message:

Improved the color testsuite : it now includes the expected results.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/tests/runcolors.py

    r381 r405  
    2323# 
    2424 
    25 """This document was created with the help of the ReportLab ToolKit (tm) 
    26 available as Free Software from http://www.reportlab.org 
     25"""This document was created with the help of the ReportLab 
     26ToolKit (tm) available as Free Software from : 
    2727 
    28 It contains 9 pages, including this one. 
     28        http://www.reportlab.org 
    2929 
    30 Each page after this one is entirely filled with 100% of a particular 
    31 color, as described below : 
     30It contains 10 pages, including this one. 
    3231 
    33 Page 1 ====> This notice 
    34 Page 2 ====> Red 
    35 Page 3 ====> Green 
    36 Page 4 ====> Blue 
    37 Page 5 ====> Cyan 
    38 Page 6 ====> Magenta 
    39 Page 7 ====> Yellow 
    40 Page 8 ====> Black 
    41 Page 9 ====> White 
     32Each page after this one is entirely filled with 100% 
     33of a particular color, as described below : 
    4234 
    43 This document helps to ensure that the computation of ink coverage 
    44 made by pkpgcounter works as expected. 
     35Page  1 ====> This notice 
     36Page  2 ====> Red 
     37Page  3 ====> Green 
     38Page  4 ====> Blue 
     39Page  5 ====> Cyan 
     40Page  6 ====> Magenta 
     41Page  7 ====> Yellow 
     42Page  8 ====> Black 
     43Page  9 ====> White 
     44Page 10 ====> The expected results. 
     45 
     46This document helps to ensure that the computation of 
     47ink coverage made by pkpgcounter works as expected. 
    4548 
    4649To check by yourself : 
     
    5356 
    5457Please report any problem to : alet@librelogiciel.com 
     58""" 
     59 
     60lastpage = """For each colorspace, the results for the last page will differ a bit from what is below. 
     61The important values are the one for pages 2 to 9 included. 
     62 
     63Colorspace : BW 
     64B :   2.355336% 
     65B :  70.196078% 
     66B :  41.568627% 
     67B :  88.627451% 
     68B :  30.196078% 
     69B :  58.823529% 
     70B :  11.764706% 
     71B : 100.000000% 
     72B :   0.000000% 
     73B :   3.500669% 
     74 
     75Colorspace : RGB 
     76R :  97.644664%      G :  97.644664%      B :  97.644664% 
     77R : 100.000000%      G :   0.000000%      B :   0.000000% 
     78R :   0.000000%      G : 100.000000%      B :   0.000000% 
     79R :   0.000000%      G :   0.000000%      B : 100.000000% 
     80R :   0.000000%      G : 100.000000%      B : 100.000000% 
     81R : 100.000000%      G :   0.000000%      B : 100.000000% 
     82R : 100.000000%      G : 100.000000%      B :   0.000000% 
     83R :   0.000000%      G :   0.000000%      B :   0.000000% 
     84R : 100.000000%      G : 100.000000%      B : 100.000000% 
     85R :  96.499331%      G :  96.499331%      B :  96.499331% 
     86 
     87Colorspace : CMY 
     88C :   2.355336%      M :   2.355336%      Y :   2.355336% 
     89C :   0.000000%      M : 100.000000%      Y : 100.000000% 
     90C : 100.000000%      M :   0.000000%      Y : 100.000000% 
     91C : 100.000000%      M : 100.000000%      Y :   0.000000% 
     92C : 100.000000%      M :   0.000000%      Y :   0.000000% 
     93C :   0.000000%      M : 100.000000%      Y :   0.000000% 
     94C :   0.000000%      M :   0.000000%      Y : 100.000000% 
     95C : 100.000000%      M : 100.000000%      Y : 100.000000% 
     96C :   0.000000%      M :   0.000000%      Y :   0.000000% 
     97C :   3.500669%      M :   3.500669%      Y :   3.500669% 
     98 
     99Colorspace : CMYK 
     100C :   0.000000%      M :   0.000000%      Y :   0.000000%      K :   2.355336% 
     101C :   0.000000%      M : 100.000000%      Y : 100.000000%      K :   0.000000% 
     102C : 100.000000%      M :   0.000000%      Y : 100.000000%      K :   0.000000% 
     103C : 100.000000%      M : 100.000000%      Y :   0.000000%      K :   0.000000% 
     104C : 100.000000%      M :   0.000000%      Y :   0.000000%      K :   0.000000% 
     105C :   0.000000%      M : 100.000000%      Y :   0.000000%      K :   0.000000% 
     106C :   0.000000%      M :   0.000000%      Y : 100.000000%      K :   0.000000% 
     107C :   0.000000%      M :   0.000000%      Y :   0.000000%      K : 100.000000% 
     108C :   0.000000%      M :   0.000000%      Y :   0.000000%      K :   0.000000% 
     109C :   0.000000%      M :   0.000000%      Y :   0.000000%      K :   3.500669% 
    55110""" 
    56111 
     
    72127     
    73128    # First we output the explanations on the first page. 
    74     canv.setFont("Helvetica", 16) 
     129    canv.setFont("Courier", 14) 
    75130    for line in __doc__.split("\n") : 
    76131        canv.drawString(xbase, ybase, line) 
    77         ybase -= 24 
     132        ybase -= 18 
    78133    canv.showPage() 
    79134     
     
    96151        canv.rect(0, 0, width, height, fill=1) 
    97152        canv.showPage() 
     153         
     154    # Finally outputs the expected results. 
     155    canv.setFont("Helvetica-Bold", 16) 
     156    canv.drawCentredString(width/2.0, height-1.5*cm, "Expected Results :") 
     157    ybase = height - 3*cm 
     158    canv.setFont("Courier", 10) 
     159    for line in lastpage.split("\n") : 
     160        canv.drawString(xbase, ybase, line) 
     161        ybase -= 14 
     162    canv.showPage() 
     163         
    98164    canv.save()