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 725b6c106fdb6f78b7eb3dfef2192182b30233ff (commit) via 5b78e184047a166ab7382f08c2c63c2fd6edc42a (commit) from be558be3368503affa22139727420e1bdd01e27d (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/725b6c106fdb6f78b7eb3dfef2192182b3023...
commit 725b6c106fdb6f78b7eb3dfef2192182b30233ff Author: Cyril Hrubis metan@ucw.cz Date: Thu Dec 6 19:35:13 2012 +0100
test: gfx: Add more polygon test cases.
diff --git a/tests/gfx/Polygon.c b/tests/gfx/Polygon.c index 96a7d72..16affdd 100644 --- a/tests/gfx/Polygon.c +++ b/tests/gfx/Polygon.c @@ -117,7 +117,24 @@ struct testcase testcase_line_vert_3px = { } };
-struct testcase testcase_line_3px = { +struct testcase testcase_line_horiz_3px = { + .edge_count = 2, + .edges = { + 3, 1, + 1, 0, + }, + .w = 5, + .h = 5, + .pixmap = { + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + } +}; + +struct testcase testcase_line_4px = { .edge_count = 2, .edges = { 1, 1, @@ -134,6 +151,23 @@ struct testcase testcase_line_3px = { } };
+struct testcase testcase_line_3px = { + .edge_count = 2, + .edges = { + 1, 1, + 3, 3, + }, + .w = 5, + .h = 5, + .pixmap = { + 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, + } +}; + struct testcase testcase_2x2_square = { .edge_count = 4, .edges = { @@ -152,6 +186,45 @@ struct testcase testcase_2x2_square = { } };
+struct testcase testcase_3x3_square = { + .edge_count = 4, + .edges = { + 1, 1, + 3, 1, + 3, 3, + 1, 3, + }, + .w = 5, + .h = 5, + .pixmap = { + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 0, + 0, 1, 1, 1, 0, + 0, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + } +}; + +struct testcase testcase_4x4_square = { + .edge_count = 4, + .edges = { + 1, 1, + 4, 1, + 4, 4, + 1, 4, + }, + .w = 6, + .h = 6, + .pixmap = { + 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 0, + 0, 1, 1, 1, 1, 0, + 0, 1, 1, 1, 1, 0, + 0, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, + } +}; + struct testcase testcase_4px_triangle = { .edge_count = 3, .edges = { @@ -169,6 +242,23 @@ struct testcase testcase_4px_triangle = { } };
+struct testcase testcase_6px_triangle = { + .edge_count = 3, + .edges = { + 1, 1, + 1, 3, + 3, 3, + }, + .w = 5, + .h = 5, + .pixmap = { + 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 1, 1, 0, 0, + 0, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + } +};
static int test_1_edge(void) { @@ -185,30 +275,60 @@ static int test_line_vert_3px(void) return test_polygon(&testcase_line_vert_3px); }
+static int test_line_horiz_3px(void) +{ + return test_polygon(&testcase_line_horiz_3px); +} + static int test_line_3px(void) { return test_polygon(&testcase_line_3px); }
+static int test_line_4px(void) +{ + return test_polygon(&testcase_line_4px); +} + static int test_2x2_square(void) { return test_polygon(&testcase_2x2_square); }
+static int test_3x3_square(void) +{ + return test_polygon(&testcase_3x3_square); +} + +static int test_4x4_square(void) +{ + return test_polygon(&testcase_4x4_square); +} + static int test_4px_triangle(void) { return test_polygon(&testcase_4px_triangle); }
+static int test_6px_triangle(void) +{ + return test_polygon(&testcase_6px_triangle); +} + const struct tst_suite tst_suite = { .suite_name = "Polygon Testsuite", .tests = { {.name = "1 Edge Polygon", .tst_fn = test_1_edge}, {.name = "5 Edges 1px Polygon", .tst_fn = test_5_edges_1px}, - {.name = "2x2 Square Polygon", .tst_fn = test_2x2_square}, - {.name = "Vert Line 3px Polygon", .tst_fn = test_line_vert_3px}, + {.name = "Vertical Line 3px Polygon", .tst_fn = test_line_vert_3px}, + {.name = "Horizonval Line 3px Polygon", .tst_fn = test_line_horiz_3px}, {.name = "Line 3px Polygon", .tst_fn = test_line_3px}, + {.name = "Line 4px Polygon", .tst_fn = test_line_4px}, + {.name = "2x2 Square Polygon", .tst_fn = test_2x2_square}, + {.name = "3x3 Square Polygon", .tst_fn = test_3x3_square}, + {.name = "4x4 Square Polygon", .tst_fn = test_4x4_square}, {.name = "Triangle 4px Polygon", .tst_fn = test_4px_triangle}, + {.name = "Triangle 6px Polygon", .tst_fn = test_6px_triangle}, {.name = NULL} } };
http://repo.or.cz/w/gfxprim.git/commit/5b78e184047a166ab7382f08c2c63c2fd6edc...
commit 5b78e184047a166ab7382f08c2c63c2fd6edc42a Author: Cyril Hrubis metan@ucw.cz Date: Thu Dec 6 19:34:19 2012 +0100
tests: gfx: Fix typos in common code.
diff --git a/tests/gfx/common.c b/tests/gfx/common.c index d261dfd..57d5db4 100644 --- a/tests/gfx/common.c +++ b/tests/gfx/common.c @@ -24,13 +24,13 @@
#include "common.h"
-static void dump_buffer(const char *pattern, int x, int y) +static void dump_buffer(const char *pattern, int w, int h) { - int i, j; + int x, y;
- for (i = 0; i < y; i++) { - for (j = 0; j < x; j++) - printf("%2x ", pattern[j + i * y]); + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) + printf("%2x ", pattern[x + y * w]); printf("n"); } } @@ -51,7 +51,7 @@ int compare_buffers(const char *pattern, const GP_Context *c) for (x = 0; x < c->w; x++) { for (y = 0; y < c->h; y++) { if (pattern[x + y * c->h] != - ((char*)c->pixels)[x + y * c->h]) { + ((char*)c->pixels)[x + y * c->w]) { err++; } }
-----------------------------------------------------------------------
Summary of changes: tests/gfx/Polygon.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++- tests/gfx/common.c | 12 +++--- 2 files changed, 129 insertions(+), 9 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.