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 14e8e751a6d78a0376951b09eff2a51c577d96ea (commit) via 0724917c736951cddddaca643b5afb079fe8841d (commit) from 1a72b271726b22e8eb7424a49e8d85084455eaa5 (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/14e8e751a6d78a0376951b09eff2a51c577d9...
commit 14e8e751a6d78a0376951b09eff2a51c577d96ea Author: Cyril Hrubis metan@ucw.cz Date: Tue Aug 21 16:04:41 2012 +0200
doc: Small fixes in grabbers docs.
diff --git a/doc/grabbers.txt b/doc/grabbers.txt index e7112cc..93af01b 100644 --- a/doc/grabbers.txt +++ b/doc/grabbers.txt @@ -122,5 +122,6 @@ The height and width are preferred values, you will most likely get frame by that width and height, but the driver may return different values if chosen width and height are not supported.
-Returns either pointer to the initialized grabber or, in case of failure, NULL -and errno is filled. +Returns either pointer to the initialized grabber or, in case of failure, +'NULL' and 'errno' is set. +
http://repo.or.cz/w/gfxprim.git/commit/0724917c736951cddddaca643b5afb079fe88...
commit 0724917c736951cddddaca643b5afb079fe8841d Author: Cyril Hrubis metan@ucw.cz Date: Tue Aug 21 15:02:26 2012 +0200
tests: Catch SIGABRT too.
diff --git a/tests/framework/test.c b/tests/framework/test.c index ddc1573..69e50eb 100644 --- a/tests/framework/test.c +++ b/tests/framework/test.c @@ -93,6 +93,16 @@ int malloc_ok_fn(void) return TST_SUCCESS; }
+int double_free(void) +{ + void *p = malloc(100); + + free(p); + free(p); + + return TST_SUCCESS; +} + const struct tst_suite suite = { .suite_name = "Testing Framework Example", .tests = { @@ -104,6 +114,7 @@ const struct tst_suite suite = { {.name = "Tempdir test", .tst_fn = temp_dir_fn, .flags = TST_TMPDIR}, {.name = "Mem Leak test", .tst_fn = malloc_leak_fn, .flags = TST_MALLOC_CHECK}, {.name = "Mem Ok test", .tst_fn = malloc_ok_fn, .flags = TST_MALLOC_CHECK}, + {.name = "Double free()", .tst_fn = double_free}, {.name = NULL}, } }; diff --git a/tests/framework/tst_job.c b/tests/framework/tst_job.c index 241e0fe..150011d 100644 --- a/tests/framework/tst_job.c +++ b/tests/framework/tst_job.c @@ -79,12 +79,17 @@ static void stop_test(struct tst_job *job) case TST_TIMEOUT: result = "e[1;35mTIMEOUTe[0m"; break; + case TST_ABORTED: + result = "e[1;31mABORTEDe[0m"; + break; case TST_MEMLEAK: result = "e[1;33mMEMLEAKe[0m"; break; case TST_FAILED: result = "e[1;31mFAILUREe[0m"; break; + case TST_MAX: + break; } fprintf(stderr, "e[1;37m%se[0m finished " @@ -272,7 +277,6 @@ void tst_job_run(struct tst_job *job) clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &job->cpu_time); write_timespec(job, 'c', &job->cpu_time);
- if (job->test->flags & TST_MALLOC_CHECK) tst_malloc_check_start();
@@ -399,7 +403,15 @@ void tst_job_wait(struct tst_job *job) case SIGALRM: job->result = TST_TIMEOUT; break; + /* + * abort() called most likely double free or malloc data + * corruption + */ + case SIGABRT: + job->result = TST_ABORTED; + break; default: + printf("%in", WTERMSIG(status)); job->result = TST_INTERR; } } diff --git a/tests/framework/tst_job.h b/tests/framework/tst_job.h index bdc9ed8..2e74a7d 100644 --- a/tests/framework/tst_job.h +++ b/tests/framework/tst_job.h @@ -33,8 +33,7 @@
#include "tst_msg.h" #include "tst_preload.h" - -struct tst_test; +#include "tst_test.h"
struct tst_job { const struct tst_test *test; @@ -63,7 +62,7 @@ struct tst_job { int pid; /* test result */ - int result; + enum tst_ret result;
/* * test malloc statistics, filled if TST_MALLOC_CHECK was set. diff --git a/tests/framework/tst_log.c b/tests/framework/tst_log.c index 578c960..cc063e4 100644 --- a/tests/framework/tst_log.c +++ b/tests/framework/tst_log.c @@ -37,6 +37,8 @@ static const char *ret_to_bg_color(enum tst_ret ret) return "#e00000"; case TST_TIMEOUT: return "#800080"; + case TST_ABORTED: + return "#e00000"; case TST_MEMLEAK: return "#a0a000"; case TST_FAILED: @@ -59,6 +61,8 @@ static const char *ret_to_str(enum tst_ret ret) return "Segmentation Fault"; case TST_TIMEOUT: return "Timeout"; + case TST_ABORTED: + return "Aborted"; case TST_MEMLEAK: return "Memory Leak"; case TST_FAILED: diff --git a/tests/framework/tst_test.h b/tests/framework/tst_test.h index 50ba271..e38b92f 100644 --- a/tests/framework/tst_test.h +++ b/tests/framework/tst_test.h @@ -24,12 +24,13 @@ #define TST_TEST_H
enum tst_ret { - TST_SUCCESS, /* Test succedded */ - TST_INTERR, /* Test framework error */ - TST_SIGSEGV, /* Test ended with SIGSEGV */ - TST_TIMEOUT, /* Test hasn't finished in time */ - TST_MEMLEAK, /* Memory leak was detected */ - TST_FAILED, /* Test failed */ + TST_SUCCESS, /* Test succedded */ + TST_INTERR, /* Test framework error */ + TST_SIGSEGV, /* Test ended with SIGSEGV */ + TST_TIMEOUT, /* Test hasn't finished in time */ + TST_ABORTED, /* The abort() was called (possible double free) */ + TST_MEMLEAK, /* Memory leak was detected */ + TST_FAILED, /* Test failed */ TST_MAX = TST_FAILED+1, };
-----------------------------------------------------------------------
Summary of changes: doc/grabbers.txt | 5 +++-- tests/framework/test.c | 11 +++++++++++ tests/framework/tst_job.c | 14 +++++++++++++- tests/framework/tst_job.h | 5 ++--- tests/framework/tst_log.c | 4 ++++ tests/framework/tst_test.h | 13 +++++++------ 6 files changed, 40 insertions(+), 12 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.