blob: c671bd323de594695e4b96cdd15022a966b9cb96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <stdio.h>
#include "gd.h"
#include "gdtest.h"
int main()
{
gdImagePtr im;
int c;
im = gdImageCreate(1, 1);
/* test for deallocating a color */
c = gdImageColorAllocate(im, 255, 255, 255);
if (c < 0) {
gdImageDestroy(im);
return 1;
}
gdImageColorDeallocate(im, c);
if (!im->open[c]) {
gdImageDestroy(im);
return 1;
}
/* just see whether it is OK with out-of-bounds values */
gdImageColorDeallocate(im, gdMaxColors);
gdImageColorDeallocate(im, -1);
gdImageDestroy(im);
return 0;
}
|