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 f5ba4d748fcead8e9acdce5a110ebb718ee8fd0c (commit) from 2a2dfc22e430b4c6af1f7a8a9a0a3fd4e1a5a216 (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/f5ba4d748fcead8e9acdce5a110ebb718ee8f...
commit f5ba4d748fcead8e9acdce5a110ebb718ee8fd0c Author: Cyril Hrubis metan@ucw.cz Date: Sat May 4 21:00:58 2013 +0200
tests: Add API coverage for GFX.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/gfx/APICoverage.gen.c.t b/tests/gfx/APICoverage.gen.c.t new file mode 100644 index 0000000..453e1ed --- /dev/null +++ b/tests/gfx/APICoverage.gen.c.t @@ -0,0 +1,138 @@ +/***************************************************************************** + * This file is part of gfxprim library. * + * * + * Gfxprim is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * Gfxprim is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with gfxprim; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * + * * + *****************************************************************************/ + + /* + + The purpose of this test is to exercise as much codepaths as possible + without checking for result corectness. + + */ + +%% extends "base.test.c.t" + +%% block body + +#include <stdio.h> + +#include <core/GP_Context.h> +#include <gfx/GP_Gfx.h> + +#include "tst_test.h" + +%% set API_List = [ + ['Fill', 'GP_Context:in', 'int:pixel'], + + ['HLine', 'GP_Context:in', 'int:x0', 'int:x1', 'int:y', 'int:pixel'], + ['VLine', 'GP_Context:in', 'int:x', 'int:y0', 'int:y1', 'int:pixel'], + + ['Line', 'GP_Context:in', 'int:x0', 'int:y0', + 'int:x1', 'int:y1', 'int:pixel'], + + ['Circle', 'GP_Context:in', 'int:xcenter', 'int:ycenter', + 'int:r', 'int:pixel'], + ['FillCircle', 'GP_Context:in', 'int:xcenter', 'int:ycenter', + 'int:r', 'int:pixel'], + + ['Ellipse', 'GP_Context:in', 'int:xcenter', 'int:ycenter', + 'int:a', 'int:b', 'int:pixel'], + ['FillEllipse', 'GP_Context:in', 'int:xcenter', 'int:ycenter', + 'int:a', 'int:b', 'int:pixel'], + + ['Ring', 'GP_Context:in', 'int:xc', 'int:yc', + 'int:r1', 'int:r2', 'int:pixel'], + ['FillRing', 'GP_Context:in', 'int:xc', 'int:yc', + 'int:r1', 'int:r2', 'int:pixel'], + + ['Rect', 'GP_Context:in', 'int:x0', 'int:y0', + 'int:x1', 'int:y1', 'int:pixel'], + ['FillRect', 'GP_Context:in', 'int:x0', 'int:y0', + 'int:x1', 'int:y1', 'int:pixel'], + + ['Triangle', 'GP_Context:in', 'int:x0', 'int:y0', + 'int:x1', 'int:y1', 'int:x2', 'int:y2', 'int:pixel'], + ['FillTriangle', 'GP_Context:in', 'int:x0', 'int:y0', + 'int:x1', 'int:y1', 'int:x2', 'int:y2', 'int:pixel'], + + ['Tetragon', 'GP_Context:in', 'int:x0', 'int:y0', 'int:x1', 'int:y1', + 'int:x2', 'int:y2', 'int:x3', 'int:y3', 'int:pixel'], + ['FillTetragon', 'GP_Context:in', 'int:x0', 'int:y0', 'int:x1', 'int:y1', + 'int:x2', 'int:y2', 'int:x3', 'int:y3', 'int:pixel'], + +] + +%% macro prep_context(id, pt) + GP_Context *{{ id }} = GP_ContextAlloc(331, 331, GP_PIXEL_{{ pt.name }}); +%% endmacro + +%% macro prep_int(id) + int {{ id }} = 2; +%% endmacro + +%% macro prep_param(param, pt) +%% if (param.split(':', 1)[0] == 'GP_Context') +{{ prep_context(param.split(':', 1)[1], pt) }} +%% endif +%% if (param.split(':', 1)[0] == 'float') +{{ prep_float(param.split(':', 1)[1]) }} +%% endif +%% if (param.split(':', 1)[0] == 'int') +{{ prep_int(param.split(':', 1)[1]) }} +%% endif +%% endmacro + +{% macro get_param(param) %}{% if len(param.split(':', 1)) == 1 %}NULL{% else %}{{ param.split(':', 1)[1] }}{% endif %}{% endmacro %} + +%% for fn in API_List +%% for pt in pixeltypes +%% if not pt.is_unknown() + +static int Gfx_{{ fn[0]}}_{{ pt.name }}(void) +{ +%% for param in fn[1:] +{{ prep_param(param, pt) }} +%% endfor + + GP_{{ fn[0] }}({{ get_param(fn[1]) }}{% for param in fn[2:] %}, {{ get_param(param) }}{% endfor %}); + + return TST_SUCCESS; +} + +%% endif +%% endfor +%% endfor + +const struct tst_suite tst_suite = { + .suite_name = "Gfx API Coverage", + .tests = { +%% for fn in API_List +%% for pt in pixeltypes +%% if not pt.is_unknown() + {.name = "{{ fn[0] }} {{ pt.name }}", + .tst_fn = Gfx_{{ fn[0] }}_{{ pt.name }}}, +%% endif +%% endfor +%% endfor + {.name = NULL} + } +}; + +%% endblock body diff --git a/tests/gfx/Makefile b/tests/gfx/Makefile index ddfdca3..cf845f6 100644 --- a/tests/gfx/Makefile +++ b/tests/gfx/Makefile @@ -1,10 +1,11 @@ TOPDIR=../.. include $(TOPDIR)/pre.mk
-CSOURCES=$(shell echo *.c) +CSOURCES=$(filter-out $(wildcard *.gen.c),$(wildcard *.c)) +GENSOURCES=APICoverage.gen.c
APPS=gfx_benchmark Circle FillCircle Line CircleSeg Polygon Ellipse HLine- VLine PutPixelAA HLineAA LineAA + VLine PutPixelAA HLineAA LineAA APICoverage.gen
Circle: common.o FillCircle: common.o @@ -20,5 +21,6 @@ LineAA: common.o
include ../tests.mk
+include $(TOPDIR)/gen.mk include $(TOPDIR)/app.mk include $(TOPDIR)/post.mk diff --git a/tests/gfx/test_list.txt b/tests/gfx/test_list.txt index 0368b0f..8070210 100644 --- a/tests/gfx/test_list.txt +++ b/tests/gfx/test_list.txt @@ -1,5 +1,7 @@ # GFX test list
+APICoverage.gen + HLine VLine Line
-----------------------------------------------------------------------
Summary of changes: tests/gfx/APICoverage.gen.c.t | 138 +++++++++++++++++++++++++++++++++++++++++ tests/gfx/Makefile | 6 +- tests/gfx/test_list.txt | 2 + 3 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 tests/gfx/APICoverage.gen.c.t
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.