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, generate has been updated via ce1f7e60318bc537190107fef5834338da94706d (commit) from 8a3762309b457c34c0da176d12b3bc76e2f486e9 (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/ce1f7e60318bc537190107fef5834338da947...
commit ce1f7e60318bc537190107fef5834338da94706d Author: Cyril Hrubis metan@ucw.cz Date: Sun Aug 21 12:03:08 2011 +0200
Small fixes for WritePixel test.
diff --git a/tests/core/GP_WritePixel.test.gen.c.t b/tests/core/GP_WritePixel.test.gen.c.t index 902a8b7..2661371 100644 --- a/tests/core/GP_WritePixel.test.gen.c.t +++ b/tests/core/GP_WritePixel.test.gen.c.t @@ -11,12 +11,16 @@ static void dump_buffer(const char *name, char *buf, unsigned int buf_len) { unsigned int i;
- printf("%s = {", name); + printf("%s:n{", name);
for (i = 0; i < buf_len; i++) { - printf("0x%02x", buf[i]); + printf("%i", !!buf[i]); + if (i != buf_len - 1) printf(", "); + + if (i % 26 == 25) + printf("n "); }
printf("}n"); @@ -25,7 +29,7 @@ static void dump_buffer(const char *name, char *buf, unsigned int buf_len) /* * Compares two statically defined buffers */ -#define COMPARE_BUFFERS(buf1, buf2) do { +#define COMPARE_BUFFERS(id, buf1, buf2) do { unsigned int buf1_len = sizeof(buf1)/sizeof(*buf1); unsigned int buf2_len = sizeof(buf2)/sizeof(*buf2); unsigned int i; @@ -33,21 +37,22 @@ static void dump_buffer(const char *name, char *buf, unsigned int buf_len) fail_unless(buf1_len == buf2_len); for (i = 0; i < buf1_len; i++) - if(buf1[i] != buf2[i]) { - dump_buffer("write", buf1, buf1_len); - dump_buffer("gen ", buf2, buf2_len); + if(buf1[i] != buf2[i]) { + printf("%sn", id); + dump_buffer("wrote", buf1, buf1_len); + dump_buffer("gen", buf2, buf2_len); fail("buffers are different"); } } while (0)
%% for pixelsize in [8, 16, 24, 32] %% for offset in range(0, 4) -%% for len in range(0, 4) +%% for len in range(0, 6) %% for aligment in [0, 1] GP_TEST(GP_WritePixel{{ "%i_%i_%i_%i"|format(pixelsize, offset, len, aligment) }}, {{ ""offset=%i len=%i aligment=%i""|format(offset, len, aligment) }}) { - char write_buf[{{ 9 * pixelsize//8 }}] = {}; - char gen_buf[{{9 * pixelsize//8 }}] = {}; + char write_buf[{{ 25 * pixelsize//8 }}] = {}; + char gen_buf[{{ 25 * pixelsize//8 }}] = {};
/* * Fill the compare buffer @@ -60,7 +65,7 @@ GP_TEST(GP_WritePixel{{ "%i_%i_%i_%i"|format(pixelsize, offset, len, aligment) }
GP_WritePixels{{ pixelsize }}bpp(write_buf + {{aligment + offset * pixelsize//8}}, {{ len }}, 0xffffffff>>{{32 - pixelsize}});
- COMPARE_BUFFERS(write_buf, gen_buf); + COMPARE_BUFFERS({{""p=%i o=%i l=%i a=%i""|format(pixelsize, offset, len, aligment)}}, write_buf, gen_buf); } GP_ENDTEST %% endfor
-----------------------------------------------------------------------
Summary of changes: tests/core/GP_WritePixel.test.gen.c.t | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 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.