add testcase for gdImageColorClosestHWB
add testcase for gdImageColorClosestHWBmaster
parent
b5a5d98209
commit
b9004db6a2
|
@ -27,6 +27,7 @@ if (BUILD_TEST)
|
|||
gdimageclone
|
||||
gdimagecolor
|
||||
gdimagecolorclosest
|
||||
gdimagecolorclosesthwb
|
||||
gdimagecolordeallocate
|
||||
gdimagecolorexact
|
||||
gdimagecolormatch
|
||||
|
|
|
@ -23,6 +23,7 @@ include gdimagebrightness/Makemodule.am
|
|||
include gdimageclone/Makemodule.am
|
||||
include gdimagecolor/Makemodule.am
|
||||
include gdimagecolorclosest/Makemodule.am
|
||||
include gdimagecolorclosesthwb/Makemodule.am
|
||||
include gdimagecolordeallocate/Makemodule.am
|
||||
include gdimagecolorexact/Makemodule.am
|
||||
include gdimagecolormatch/Makemodule.am
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
/gdImageColorClosestHWB
|
|
@ -0,0 +1,7 @@
|
|||
IF(PNG_FOUND)
|
||||
LIST(APPEND TESTS_FILES
|
||||
gdImageColorClosestHWB
|
||||
)
|
||||
ENDIF(PNG_FOUND)
|
||||
|
||||
ADD_GD_TESTS()
|
|
@ -0,0 +1,7 @@
|
|||
if HAVE_LIBPNG
|
||||
libgd_test_programs += \
|
||||
gdimagecolorclosesthwb/gdImageColorClosestHWB
|
||||
endif
|
||||
|
||||
EXTRA_DIST += \
|
||||
gdimagecolorclosesthwb/CMakeLists.txt
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Basic test for gdImageColorClosestHWB()
|
||||
**/
|
||||
#include "gd.h"
|
||||
#include "gdtest.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
gdImagePtr im;
|
||||
FILE *fp;
|
||||
|
||||
fp = gdTestFileOpen2("gdimageflip", "remi.png");
|
||||
im = gdImageCreateFromPng(fp);
|
||||
fclose(fp);
|
||||
|
||||
int result = gdImageColorClosestHWB(im, 255, 0, 255);
|
||||
|
||||
if (gdTestAssert(result <= 0))
|
||||
{
|
||||
gdImageDestroy(im);
|
||||
return 1;
|
||||
}
|
||||
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue