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 82d3a2388b9c9001295fbaf68efe9a11469dbf65 (commit) from 101233f4b4f483e4633302fe978f051ee5c4e472 (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/82d3a2388b9c9001295fbaf68efe9a11469db...
commit 82d3a2388b9c9001295fbaf68efe9a11469dbf65 Author: Cyril Hrubis metan@ucw.cz Date: Sat Oct 20 11:45:59 2012 +0200
tests: core: More cases for GetPutPixel.
diff --git a/tests/core/GetPutPixel.gen.c.t b/tests/core/GetPutPixel.gen.c.t index b462bce..5f1354a 100644 --- a/tests/core/GetPutPixel.gen.c.t +++ b/tests/core/GetPutPixel.gen.c.t @@ -35,8 +35,8 @@ static void fill_context(GP_Context *c, GP_Pixel p) { GP_Coord x, y;
- for (x = 0; x < c->w; x++) - for (y = 0; y < c->h; y++) + for (x = 0; x < (GP_Coord)c->w; x++) + for (y = 0; y < (GP_Coord)c->h; y++) GP_PutPixel(c, x, y, p); }
@@ -47,8 +47,8 @@ static int check_filled(GP_Context *c)
p = GP_GetPixel(c, 0, 0);
- for (x = 0; x < c->w; x++) - for (y = 0; y < c->h; y++) + for (x = 0; x < (GP_Coord)c->w; x++) + for (y = 0; y < (GP_Coord)c->h; y++) if (p != GP_GetPixel(c, x, y)) { tst_report(0, "Pixels different %i %i", x, y); return 1; @@ -80,7 +80,7 @@ static int GetPutPixel_{{ pt.name }}(void)
if (c == NULL) { tst_report(0, "GP_ContextAlloc() failed"); - return TST_FAILED; + return TST_UNTESTED; }
if (try_pattern(c, 0x55555555 & {{ 2 ** pt.pixelsize.size - 1}})) @@ -105,6 +105,51 @@ static int GetPutPixel_{{ pt.name }}(void) %% endif %% endfor
+%% for pt in pixeltypes +%% if not pt.is_unknown() +static int GetPutPixel_Clipping_{{ pt.name }}(void) +{ + GP_Context *c; + + c = GP_ContextAlloc(100, 100, GP_PIXEL_{{ pt.name }}); + + if (c == NULL) { + tst_report(0, "GP_ContextAlloc() failed"); + return TST_UNTESTED; + } + + fill_context(c, 0xffffffff); + + GP_Coord x, y; + int err = 0; + + for (x = -1000; x < 200; x++) { + for (y = -1000; y < 200; y++) { + if (x > 0 && x < 100 && y > 0 && y < 100) + continue; + + /* Must be no-op */ + GP_PutPixel(c, x, y, 0); + + /* Must return 0 */ + if (GP_GetPixel(c, x, y) != 0) { + tst_report(0, "GP_GetPixel returned non-zero " + "at %i %i", x, y); + err++; + } + } + } + + GP_ContextFree(c); + + if (err) + return TST_FAILED; + + return TST_SUCCESS; +} +%% endif +%% endfor + const struct tst_suite tst_suite = { .suite_name = "GetPutPixel Testsuite", .tests = { @@ -114,6 +159,13 @@ const struct tst_suite tst_suite = { .tst_fn = GetPutPixel_{{ pt.name }}}, %% endif %% endfor + +%% for pt in pixeltypes +%% if not pt.is_unknown() + {.name = "GetPutPixel Clipping {{ pt.name }}", + .tst_fn = GetPutPixel_Clipping_{{ pt.name }}}, +%% endif +%% endfor {.name = NULL} }
-----------------------------------------------------------------------
Summary of changes: tests/core/GetPutPixel.gen.c.t | 62 ++++++++++++++++++++++++++++++++++++--- 1 files changed, 57 insertions(+), 5 deletions(-)
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.