This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 3f35d87f9ab132a5e60d3c6d7d8324af2da43653 (commit) from 82d3a2388b9c9001295fbaf68efe9a11469dbf65 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/3f35d87f9ab132a5e60d3c6d7d8324af2da43...
commit 3f35d87f9ab132a5e60d3c6d7d8324af2da43653 Author: Cyril Hrubis metan@ucw.cz Date: Sat Oct 20 12:46:32 2012 +0200
tests: loaders: More JPEG and PNG tests.
diff --git a/tests/loaders/data/jpeg/valid/100x100-red.jpeg b/tests/loaders/data/jpeg/valid/100x100-red.jpeg new file mode 100644 index 0000000..0101283 Binary files /dev/null and b/tests/loaders/data/jpeg/valid/100x100-red.jpeg differ diff --git a/tests/loaders/data/png/valid/100x100-red-alpha.png b/tests/loaders/data/png/valid/100x100-red-alpha.png new file mode 100644 index 0000000..31ca1bc Binary files /dev/null and b/tests/loaders/data/png/valid/100x100-red-alpha.png differ diff --git a/tests/loaders/data/png/valid/100x100-red.png b/tests/loaders/data/png/valid/100x100-red.png new file mode 100644 index 0000000..4bf87f3 Binary files /dev/null and b/tests/loaders/data/png/valid/100x100-red.png differ diff --git a/tests/loaders/loaders_suite.c b/tests/loaders/loaders_suite.c index de84a8e..c87c6f9 100644 --- a/tests/loaders/loaders_suite.c +++ b/tests/loaders/loaders_suite.c @@ -561,6 +561,71 @@ static int test_load_BMP_8bpp_1x64000(void) return test_load_BMP("8bpp-1x64000.bmp"); }
+static int test_load_PNG(const char *path) +{ + GP_Context *img; + + img = GP_LoadPNG(path, NULL); + + if (img == NULL) { + switch (errno) { + case ENOSYS: + tst_report(0, "Not Implemented"); + return TST_SKIPPED; + default: + tst_report(0, "Got %s", strerror(errno)); + return TST_FAILED; + } + } + + /* + * TODO: check correct data. + */ + GP_ContextFree(img); + + return TST_SUCCESS; +} + +static int test_load_PNG_100x100(void) +{ + return test_load_PNG("100x100-red.png"); +} + +static int test_load_PNG_100x100_alpha(void) +{ + return test_load_PNG("100x100-red-alpha.png"); +} + +static int test_load_JPEG(const char *path) +{ + GP_Context *img; + + img = GP_LoadJPG(path, NULL); + + if (img == NULL) { + switch (errno) { + case ENOSYS: + tst_report(0, "Not Implemented"); + return TST_SKIPPED; + default: + tst_report(0, "Got %s", strerror(errno)); + return TST_FAILED; + } + } + + /* + * TODO: check correct data. + */ + GP_ContextFree(img); + + return TST_SUCCESS; +} + +static int test_load_JPEG_100x100(void) +{ + return test_load_JPEG("100x100-red.jpeg"); +} + const struct tst_suite tst_suite = { .suite_name = "Image Loaders testsuite", .tests = { @@ -615,29 +680,60 @@ const struct tst_suite tst_suite = { .flags = TST_TMPDIR | TST_CHECK_MALLOC},
/* BPM loader tests */ - {.name = "BMP Load 1bpp 1x1", .tst_fn = test_load_BMP_1bpp_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/1bpp-1x1.bmp"}, + {.name = "BMP Load 1bpp 1x1", + .tst_fn = test_load_BMP_1bpp_1x1, + .res_path = "data/bmp/bitmaps/valid/1bpp-1x1.bmp", + .flags = TST_TMPDIR}, - {.name = "BMP Load 4bpp 1x1", .tst_fn = test_load_BMP_4bpp_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/4bpp-1x1.bmp"}, + {.name = "BMP Load 4bpp 1x1", + .tst_fn = test_load_BMP_4bpp_1x1, + .res_path = "data/bmp/bitmaps/valid/4bpp-1x1.bmp", + .flags = TST_TMPDIR}, - {.name = "BMP Load 8bpp 1x1", .tst_fn = test_load_BMP_8bpp_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/8bpp-1x1.bmp"}, + {.name = "BMP Load 8bpp 1x1", + .tst_fn = test_load_BMP_8bpp_1x1, + .res_path = "data/bmp/bitmaps/valid/8bpp-1x1.bmp", + .flags = TST_TMPDIR}, - {.name = "BMP 24bpp 1x1", .tst_fn = test_load_BMP_24bpp_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/24bpp-1x1.bmp"}, + {.name = "BMP 24bpp 1x1", + .tst_fn = test_load_BMP_24bpp_1x1, + .res_path = "data/bmp/bitmaps/valid/24bpp-1x1.bmp", + .flags = TST_TMPDIR}, - {.name = "BMP 32bpp 1x1", .tst_fn = test_load_BMP_32bpp_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/32bpp-1x1.bmp"}, + {.name = "BMP 32bpp 1x1", + .tst_fn = test_load_BMP_32bpp_1x1, + .res_path = "data/bmp/bitmaps/valid/32bpp-1x1.bmp", + .flags = TST_TMPDIR}, - {.name = "BMP 555 1x1", .tst_fn = test_load_BMP_555_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/555-1x1.bmp"}, + {.name = "BMP 555 1x1", + .tst_fn = test_load_BMP_555_1x1, + .res_path = "data/bmp/bitmaps/valid/555-1x1.bmp", + .flags = TST_TMPDIR}, - {.name = "BMP 565 1x1", .tst_fn = test_load_BMP_565_1x1, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/565-1x1.bmp"}, + {.name = "BMP 565 1x1", + .tst_fn = test_load_BMP_565_1x1, + .res_path = "data/bmp/bitmaps/valid/565-1x1.bmp", + .flags = TST_TMPDIR}, + + {.name = "BMP 8bpp 1x64000", + .tst_fn = test_load_BMP_8bpp_1x64000, + .res_path = "data/bmp/bitmaps/valid/8bpp-1x64000.bmp", + .flags = TST_TMPDIR}, + + /* PNG loader tests */ + {.name = "PNG 100x100", .tst_fn = test_load_PNG_100x100, + .res_path = "data/png/valid/100x100-red.png", + .flags = TST_TMPDIR}, - {.name = "BMP 8bpp 1x64000", .tst_fn = test_load_BMP_8bpp_1x64000, - .flags = TST_TMPDIR, .res_path = "data/bmp/bitmaps/valid/8bpp-1x64000.bmp"}, + {.name = "PNG 100x100 50% alpha", + .tst_fn = test_load_PNG_100x100_alpha, + .res_path = "data/png/valid/100x100-red-alpha.png", + .flags = TST_TMPDIR}, + + /* JPEG loader tests */ + {.name = "JPEG 100x100", .tst_fn = test_load_JPEG_100x100, + .res_path = "data/jpeg/valid/100x100-red.jpeg", + .flags = TST_TMPDIR},
{.name = NULL}, }
-----------------------------------------------------------------------
Summary of changes: tests/loaders/data/jpeg/valid/100x100-red.jpeg | Bin 0 -> 382 bytes tests/loaders/data/png/valid/100x100-red-alpha.png | Bin 0 -> 315 bytes tests/loaders/data/png/valid/100x100-red.png | Bin 0 -> 309 bytes tests/loaders/loaders_suite.c | 128 +++++++++++++++++--- 4 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 tests/loaders/data/jpeg/valid/100x100-red.jpeg create mode 100644 tests/loaders/data/png/valid/100x100-red-alpha.png create mode 100644 tests/loaders/data/png/valid/100x100-red.png
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.