~ubuntu-branches/ubuntu/intrepid/libgd2/intrepid-updates

« back to all changes in this revision

Viewing changes to tests/gdimagefill/bug00002_4.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-06 21:15:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070206211532-p00rbx2wak0ls19y
Tags: 2.0.34~rc1-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Drop unnecessary build dependency 'gnulib'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*ImageFill Pattern fill */
 
2
 
 
3
#include "gd.h"
 
4
#include "gdtest.h"
 
5
 
 
6
int main()
 
7
{
 
8
        gdImagePtr im;
 
9
        FILE *fp;
 
10
        int red, blue, white, black, error = 0;
 
11
 
 
12
        im = gdImageCreate(50,100);
 
13
        red = gdImageColorAllocate(im, 255, 0, 0);
 
14
        blue = gdImageColorAllocate(im, 0,0,255);
 
15
        white  = gdImageColorAllocate(im, 255,255,255);
 
16
        black = gdImageColorAllocate(im, 0,0,0);
 
17
        gdImageFill(im, 0,0, black);
 
18
 
 
19
        gdImageLine(im, 20,20,180,20, white);
 
20
        gdImageLine(im, 20,20,20,70, blue);
 
21
        gdImageLine(im, 20,70,180,70, red);
 
22
        gdImageLine(im, 180,20,180,45, white);
 
23
        gdImageLine(im, 180,70,180,45, red);
 
24
        gdImageLine(im, 20,20,100,45, blue);
 
25
        gdImageLine(im, 20,70,100,45, blue);
 
26
        gdImageLine(im, 100,45,180,45, red);
 
27
 
 
28
        gdImageFill(im, 21,45, blue);
 
29
        gdImageFill(im, 100,69, red);
 
30
        gdImageFill(im, 100,21, white);
 
31
 
 
32
        if (!gdAssertImageEqualsToFile("bug00002_4_exp.png", im)) {
 
33
                error = 1;
 
34
        }
 
35
 
 
36
        /* Destroy it */
 
37
        gdImageDestroy(im);
 
38
        return error;
 
39
}