summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-22 21:48:11 +0100
committerJeremy Allison <jra@samba.org>2013-03-01 11:59:09 -0800
commitdea5115a3d92f1ea91d354849f382a08957c8ba9 (patch)
tree390871e9639a70e409ef800b21c5f05da0eb3b9d /lib
parent5c31b152d26dc726b24cf6e8d6d09d1c7b5aa86f (diff)
downloadsamba-dea5115a3d92f1ea91d354849f382a08957c8ba9.tar.gz
samba-dea5115a3d92f1ea91d354849f382a08957c8ba9.tar.bz2
samba-dea5115a3d92f1ea91d354849f382a08957c8ba9.zip
tevent: fix some compiler warnings in testsuite.c
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tevent/testsuite.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/tevent/testsuite.c b/lib/tevent/testsuite.c
index 3d2a79adcf..e053682047 100644
--- a/lib/tevent/testsuite.c
+++ b/lib/tevent/testsuite.c
@@ -74,7 +74,9 @@ static bool test_event_context(struct torture_context *test,
#ifdef SA_RESTART
struct tevent_signal *se1 = NULL;
#endif
+#ifdef SA_RESETHAND
struct tevent_signal *se2 = NULL;
+#endif
#ifdef SA_SIGINFO
struct tevent_signal *se3 = NULL;
#endif
@@ -88,7 +90,8 @@ static bool test_event_context(struct torture_context *test,
return true;
}
- torture_comment(test, "Testing event backend '%s'\n", backend);
+ torture_comment(test, "backend '%s' - %s\n",
+ backend, __FUNCTION__);
/* reset globals */
fde_count = 0;
@@ -105,12 +108,15 @@ static bool test_event_context(struct torture_context *test,
#ifdef SA_RESTART
se1 = tevent_add_signal(ev_ctx, ev_ctx, SIGALRM, SA_RESTART, count_handler, &alarm_count);
+ torture_assert(test, se1 != NULL, "failed to setup se1");
#endif
#ifdef SA_RESETHAND
se2 = tevent_add_signal(ev_ctx, ev_ctx, SIGALRM, SA_RESETHAND, count_handler, &alarm_count);
+ torture_assert(test, se2 != NULL, "failed to setup se2");
#endif
#ifdef SA_SIGINFO
se3 = tevent_add_signal(ev_ctx, ev_ctx, SIGUSR1, SA_SIGINFO, count_handler, &info_count);
+ torture_assert(test, se3 != NULL, "failed to setup se3");
#endif
write(fd[1], &c, 1);
@@ -141,6 +147,14 @@ static bool test_event_context(struct torture_context *test,
torture_assert_int_equal(test, alarm_count, 1+fde_count, "alarm count mismatch");
+#ifdef SA_RESETHAND
+ /*
+ * we do not call talloc_free(se2)
+ * because it is already gone,
+ * after triggering the event handler.
+ */
+#endif
+
#ifdef SA_SIGINFO
talloc_free(se3);
torture_assert_int_equal(test, info_count, fde_count, "info count mismatch");