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 f553db48b5df795253902ce74770f57217b642ab (commit) via ff4fe6a3deedee19d4472c17568f13c3a029475b (commit) via dfefe1528e754ca7f9908dafb4544c08a78f6e6c (commit) from cf69cb4b75d228a01a4d7b803e6dfd2d32efbef3 (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/f553db48b5df795253902ce74770f57217b64...
commit f553db48b5df795253902ce74770f57217b642ab Merge: ff4fe6a cf69cb4 Author: Tomas Gavenciak gavento@ucw.cz Date: Sun May 22 13:07:05 2011 +0200
Merge branch 'master' of git://repo.or.cz/gfxprim
Conflicts: core/GP_Common.h
http://repo.or.cz/w/gfxprim.git/commit/ff4fe6a3deedee19d4472c17568f13c3a0294...
commit ff4fe6a3deedee19d4472c17568f13c3a029475b Author: Tomas Gavenciak gavento@ucw.cz Date: Sun May 22 13:05:42 2011 +0200
Tests for GP_ASSERT/CHECK/ABORT, minor fix (ambiguous else)
diff --git a/core/GP_Common.h b/core/GP_Common.h index 19cc9b9..d077f33 100644 --- a/core/GP_Common.h +++ b/core/GP_Common.h @@ -83,11 +83,12 @@ * Internal macro with common code for GP_ASSERT and GP_CHECK. */ #define GP_GENERAL_CHECK(check_cond_, check_message_, ...) do { - if (unlikely(!(check_cond_))) + if (unlikely(!(check_cond_))) { if (#__VA_ARGS__ [0]) GP_ABORT(check_message_ #check_cond_ "n" __VA_ARGS__); else GP_ABORT(check_message_ #check_cond_); + } } while (0)
/* diff --git a/core/tests/common.test.c b/core/tests/GP_Comon.test.c similarity index 83% rename from core/tests/common.test.c rename to core/tests/GP_Comon.test.c index c7bd904..9faa290 100644 --- a/core/tests/common.test.c +++ b/core/tests/GP_Comon.test.c @@ -64,3 +64,26 @@ GP_TEST(set_bits) fail_unless(x == 0xF108F000); } END_TEST + +GP_TEST(abort_check_assert, "loop_start=0, loop_end=9, expect_exit=1") +{ + if (_i==0) GP_ABORT(); + if (_i==1) GP_ABORT("MSG"); + if (_i==2) GP_ABORT("FORMAT %d", _i); + if (_i==3) GP_ASSERT(1==0); + if (_i==4) GP_ASSERT(1==0, "MSG"); + if (_i==5) GP_ASSERT(1==0, "FORMAT %d", _i); + if (_i==6) GP_CHECK(1==0); + if (_i==7) GP_CHECK(1==0, "MSG"); + if (_i==8) GP_CHECK(1==0, "FORMAT %d", _i); +} +END_TEST + +GP_TEST(assert_check_nop) +{ + GP_ASSERT(1); + GP_ASSERT(1, "MSG"); + GP_CHECK(1); + GP_CHECK(1, "MSG"); +} +END_TEST
http://repo.or.cz/w/gfxprim.git/commit/dfefe1528e754ca7f9908dafb4544c08a78f6...
commit dfefe1528e754ca7f9908dafb4544c08a78f6e6c Author: Tomas Gavenciak gavento@ucw.cz Date: Sun May 22 13:03:54 2011 +0200
Added looping, exit and signal handling to test parameters
diff --git a/core/tests/GP_Tests.h b/core/tests/GP_Tests.h index 6068d67..1735f60 100644 --- a/core/tests/GP_Tests.h +++ b/core/tests/GP_Tests.h @@ -33,9 +33,13 @@ * The optional string is passed as parameters to Python dict() as parameters * for the testcase-generator. * Currently, the following parameters are recognized: - * suite -- name of the suite + * suite -- name of the suite + * loop_start -- test will be repeated as with: + * loop_end for (int _i = loop_start; _i < loop_end; i++) { ... } + * expect_exit -- expect the function to exit with given exitcode + * expect_signal -- expect the function to exit with given exitcode * - * Do NOT use parameters: name, fname, line + * Parameters name, fname, line are used internally, do not use them */
#define GP_TEST(name, ...) static void name(int);diff --git a/core/tests/find_tests.py b/core/tests/find_tests.py index c16c881..7ddc7fb 100644 --- a/core/tests/find_tests.py +++ b/core/tests/find_tests.py @@ -91,19 +91,25 @@ def gen_tests(f): " * Test %s/%s defined in %s:%dn" " */nn" % (suite, t['name'], t['fname'], t['line'])) f.write("void GP_TEST_%s(int);nn" - "TCase *GP_TC_%s()n" + "TCase *GP_TC_%s_%s()n" "{n" - " TCase *tc = tcase_create("%s");n" - " tcase_add_test(tc, GP_TEST_%s);n" - " return tc;n" - "}nn" % (t['name'], t['name'], t['name'], t['name'])) + " TCase *tc = tcase_create("%s");n" % + (t['name'], suite, t['name'], t['name'])) + signal = t.get('expect_signal', 0) + exitval = t.get('expect_exit', 0) + assert ('loop_start' in t) == ('loop_end' in t) + loop_start = t.get('loop_start', 0) + loop_end = t.get('loop_end', 1) + f.write(" _tcase_add_test(tc, GP_TEST_%s, "%s", %d, %d, %d, %d);n" % + (t['name'], t['name'], signal, exitval, loop_start, loop_end)) + f.write(" return tc;n}nn") # TODO: Handle special test requirements (timing, fixture, ...)
f.write("Suite *GP_TS_%s()n" "{n" " Suite *s = suite_create("%s");n" % (suite, suite)) for t in tests: - f.write(" suite_add_tcase(s, GP_TC_%s());n" % (t['name'])) + f.write(" suite_add_tcase(s, GP_TC_%s_%s());n" % (suite, t['name'])) f.write(" return s;n" "}nn")
-----------------------------------------------------------------------
Summary of changes: core/GP_Common.h | 2 +- core/tests/{common.test.c => GP_Comon.test.c} | 23 +++++++++++++++++++++++ core/tests/GP_Tests.h | 8 ++++++-- core/tests/find_tests.py | 18 ++++++++++++------ 4 files changed, 42 insertions(+), 9 deletions(-) rename core/tests/{common.test.c => GP_Comon.test.c} (83%)
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.