summaryrefslogtreecommitdiff
path: root/source4/torture/local/event.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-10-16 13:06:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:12 -0500
commit8773e743c518578584d07d35ffdafdd598af88b0 (patch)
tree89726232dd6ae9eca1c219e21729a9b2336ddaa9 /source4/torture/local/event.c
parent0f2347e417dec4a50f95d64353b260cd53a44a2b (diff)
downloadsamba-8773e743c518578584d07d35ffdafdd598af88b0.tar.gz
samba-8773e743c518578584d07d35ffdafdd598af88b0.tar.bz2
samba-8773e743c518578584d07d35ffdafdd598af88b0.zip
r19339: Merge my 4.0-unittest branch. This adds an API for more fine-grained
output in the testsuite rather than just True or False for a set of tests. The aim is to use this for: * known failure lists (run all tests and detect tests that started working or started failing). This would allow us to get rid of the RPC-SAMBA3-* tests * nicer torture output * simplification of the testsuite system * compatibility with other unit testing systems * easier usage of smbtorture (being able to run one test and automatically set up the environment for that) This is still a work-in-progress; expect more updates over the next couple of days. (This used to be commit 0eb6097305776325c75081356309115f445a7218)
Diffstat (limited to 'source4/torture/local/event.c')
-rw-r--r--source4/torture/local/event.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/source4/torture/local/event.c b/source4/torture/local/event.c
index f55cd8d466..6579b1b277 100644
--- a/source4/torture/local/event.c
+++ b/source4/torture/local/event.c
@@ -40,13 +40,13 @@ static void fde_handler(struct event_context *ev_ctx, struct fd_event *f,
{
int *fd = private;
- torture_comment(test, "event[%d] fd[%d] events[0x%08X]%s%s", fde_count,
- *fd, flags,
+ torture_comment(test, "event[%d] fd[%d] events[0x%08X]%s%s\n",
+ fde_count, *fd, flags,
(flags & EVENT_FD_READ)?" EVENT_FD_READ":"",
(flags & EVENT_FD_WRITE)?" EVENT_FD_WRITE":"");
if (fde_count > 5) {
- torture_fail(test, "got more than fde 5 events - bug!");
+ _torture_fail_ext(test, "got more than fde 5 events - bug!");
talloc_free(fde);
fde = NULL;
return;
@@ -59,13 +59,13 @@ static void fde_handler(struct event_context *ev_ctx, struct fd_event *f,
static void timed_handler(struct event_context *ev_ctx, struct timed_event *te,
struct timeval tval, void *private)
{
- torture_comment(test, "timed_handler called[%d]", te_count);
+ torture_comment(test, "timed_handler called[%d]\n", te_count);
if (te_count > 2) {
close(write_fd);
write_fd = -1;
}
if (te_count > 5) {
- torture_comment(test, "remove fd event!");
+ torture_comment(test, "remove fd event!\n");
talloc_free(fde);
fde = NULL;
return;
@@ -74,17 +74,19 @@ static void timed_handler(struct event_context *ev_ctx, struct timed_event *te,
event_add_timed(ev_ctx, ev_ctx, timeval_current_ofs(0,500), timed_handler, private);
}
-static BOOL test_event_context(struct torture_context *torture, const void *_data)
+static bool test_event_context(struct torture_context *torture_ctx,
+ const void *test_data)
{
struct event_context *ev_ctx;
int fd[2] = { -1, -1 };
- BOOL try_epoll = (BOOL)_data;
+ BOOL try_epoll = (BOOL)test_data;
+ TALLOC_CTX *mem_ctx = torture_ctx;
- ev_ctx = event_context_init_ops(torture,
+ ev_ctx = event_context_init_ops(mem_ctx,
event_standard_get_ops(),
&try_epoll);
- test = torture;
+ test = torture_ctx;
/* reset globals */
write_fd = -1;
@@ -108,13 +110,12 @@ static BOOL test_event_context(struct torture_context *torture, const void *_dat
close(write_fd);
talloc_free(ev_ctx);
-
- return True;
+ return true;
}
struct torture_suite *torture_local_event(TALLOC_CTX *mem_ctx)
{
- struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-EVENT");
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "EVENT");
torture_suite_add_simple_tcase(suite, "standard with select",
test_event_context,