diff options
author | pajoye <none@none> | 2007-10-02 09:01:53 +0000 |
---|---|---|
committer | pajoye <none@none> | 2007-10-02 09:01:53 +0000 |
commit | 9bf4f83bf35bb62786ac3fca295044e3e43e737c (patch) | |
tree | 09421811c50710e5307d73cddbdae51d47348756 /tests/gdimagefilltoborder | |
parent | a31cbb85d97e4e7f55434958a40e58362a8af425 (diff) | |
download | libgd-9bf4f83bf35bb62786ac3fca295044e3e43e737c.tar.gz |
- mv src/tests tests
Diffstat (limited to 'tests/gdimagefilltoborder')
-rw-r--r-- | tests/gdimagefilltoborder/.cvsignore | 5 | ||||
-rw-r--r-- | tests/gdimagefilltoborder/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tests/gdimagefilltoborder/bug00037.c | 30 |
3 files changed, 44 insertions, 0 deletions
diff --git a/tests/gdimagefilltoborder/.cvsignore b/tests/gdimagefilltoborder/.cvsignore new file mode 100644 index 0000000..61fe4b9 --- /dev/null +++ b/tests/gdimagefilltoborder/.cvsignore @@ -0,0 +1,5 @@ +CMakeFiles +DartTestfile.txt +Makefile +cmake_install.cmake +bug00037 diff --git a/tests/gdimagefilltoborder/CMakeLists.txt b/tests/gdimagefilltoborder/CMakeLists.txt new file mode 100644 index 0000000..5a0ca42 --- /dev/null +++ b/tests/gdimagefilltoborder/CMakeLists.txt @@ -0,0 +1,9 @@ + +SET(TESTS_FILES + bug00037 +) +FOREACH(test_name ${TESTS_FILES}) + add_executable(${test_name} "${test_name}.c") + target_link_libraries (${test_name} gdTest ${GD_LIB}) + ADD_TEST(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name}) +ENDFOREACH(test_name)
\ No newline at end of file diff --git a/tests/gdimagefilltoborder/bug00037.c b/tests/gdimagefilltoborder/bug00037.c new file mode 100644 index 0000000..561d776 --- /dev/null +++ b/tests/gdimagefilltoborder/bug00037.c @@ -0,0 +1,30 @@ +#include <gd.h> +#include <stdio.h> +#include "gdtest.h" + +int main() +{ + gdImagePtr im; + int bordercolor, color; + + im = gdImageCreateTrueColor(100, 100); + + gdImageAlphaBlending(im, 1); + gdImageSaveAlpha(im, 1); + bordercolor = gdImageColorAllocateAlpha(im, 0, 0, 0, 2); + color = gdImageColorAllocateAlpha(im, 0, 0, 0, 1); + + gdImageFillToBorder(im, 5, 5, bordercolor, color); + + color = gdImageGetPixel(im, 5, 5); + + gdImageDestroy(im); + if (gdTestAssert(color==0x1000000)) { + return 0; + } else { + printf("c: %X, expected %X\n", color, 0x1000000); + return -1; + } + +} + |