add testcase for gdImageCopyMergeGray
parent
c6880dc209
commit
39facb195f
|
@ -36,6 +36,7 @@ if (BUILD_TEST)
|
|||
gdimageconvolution
|
||||
gdimagecopy
|
||||
gdimagecopymerge
|
||||
gdimagecopymergegray
|
||||
gdimagecopyresampled
|
||||
gdimagecopyrotated
|
||||
gdimagecreate
|
||||
|
|
|
@ -32,6 +32,7 @@ include gdimagecontrast/Makemodule.am
|
|||
include gdimageconvolution/Makemodule.am
|
||||
include gdimagecopy/Makemodule.am
|
||||
include gdimagecopymerge/Makemodule.am
|
||||
include gdimagecopymergegray/Makemodule.am
|
||||
include gdimagecopyresampled/Makemodule.am
|
||||
include gdimagecopyrotated/Makemodule.am
|
||||
include gdimagecreate/Makemodule.am
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
/gdimagecopymergegray
|
|
@ -0,0 +1,7 @@
|
|||
IF(PNG_FOUND)
|
||||
LIST(APPEND TESTS_FILES
|
||||
gdimagecopymergegray
|
||||
)
|
||||
ENDIF(PNG_FOUND)
|
||||
|
||||
ADD_GD_TESTS()
|
|
@ -0,0 +1,8 @@
|
|||
if HAVE_LIBPNG
|
||||
libgd_test_programs += \
|
||||
gdimagecopymergegray/gdimagecopymergegray
|
||||
endif
|
||||
|
||||
EXTRA_DIST += \
|
||||
gdimagecopymergegray/CMakeLists.txt \
|
||||
gdimagecopymergegray/gdimagecopymergegray_exp.png
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Basic test for gdImageCopyMergeGray()
|
||||
*/
|
||||
#include "gd.h"
|
||||
#include "gdtest.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
gdImagePtr dst = NULL;
|
||||
gdImagePtr src = NULL;
|
||||
int error = 0;
|
||||
|
||||
dst = gdImageCreate(100, 100);
|
||||
src = gdImageCreate(50, 50);
|
||||
|
||||
if (gdTestAssert(!dst)) {
|
||||
error = 1;
|
||||
goto done;
|
||||
}
|
||||
if (gdTestAssert(!src)) {
|
||||
error = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
gdImageColorAllocate(src, 255, 255, 255);
|
||||
gdImageColorAllocate(dst, 0, 0, 0);
|
||||
gdImageCopyMergeGray(dst, src, 25, 25, 0, 0, 50, 50, 50);
|
||||
|
||||
if (!gdAssertImageEqualsToFile("gdimagecopymergegray/gdimagecopymergegray_exp.png", dst)) {
|
||||
error = 1;
|
||||
}
|
||||
|
||||
done:
|
||||
gdImageDestroy(dst);
|
||||
gdImageDestroy(src);
|
||||
|
||||
return error;
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 124 B |
Loading…
Reference in New Issue