From 3241af44d0b6b1fc7b91f140441a9f2a2da9fffd Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Wed, 8 Sep 2004 08:11:56 +0000 Subject: [PATCH] Add signal handler so code coverage records coverage (Logical change 1.67) git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@244 fd59a12c-fef9-0310-b244-a6a79926bd2f --- test/testamf1.c | 8 ++++++++ test/testamf2.c | 8 ++++++++ test/testamf3.c | 8 ++++++++ test/testamf4.c | 9 +++++++++ test/testamf5.c | 7 +++++++ test/testamf6.c | 8 ++++++++ test/testclm.c | 8 ++++++++ 7 files changed, 56 insertions(+) diff --git a/test/testamf1.c b/test/testamf1.c index bb821156..dd41584c 100644 --- a/test/testamf1.c +++ b/test/testamf1.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -238,6 +240,11 @@ static struct sched_param sched_param = { sched_priority: 99 }; +void sigintr_handler (int signum) { + exit (0); +} + + int main (void) { SaAmfHandleT handle; int result; @@ -245,6 +252,7 @@ int main (void) { fd_set read_fds; SaNameT compName; + signal (SIGINT, sigintr_handler); result = sched_setscheduler (0, SCHED_RR, &sched_param); if (result == -1) { printf ("couldn't set sched priority\n"); diff --git a/test/testamf2.c b/test/testamf2.c index 8d57a8b5..751f2b56 100644 --- a/test/testamf2.c +++ b/test/testamf2.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -235,6 +236,11 @@ SaAmfCallbacksT amfCallbacks = { SaVersionT version = { 'A', 1, 1 }; +void sigintr_handler (int signum) { + exit (0); +} + + int main (void) { SaAmfHandleT handle; int result; @@ -244,6 +250,8 @@ int main (void) { int i; SaAmfErrorDescriptorT errorDescriptor; + signal (SIGINT, sigintr_handler); + result = saAmfInitialize (&handle, &amfCallbacks, &version); if (result != SA_OK) { printf ("initialize result is %d\n", result); diff --git a/test/testamf3.c b/test/testamf3.c index bf922770..cb85ca18 100644 --- a/test/testamf3.c +++ b/test/testamf3.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -233,6 +235,11 @@ SaAmfCallbacksT amfCallbacks = { SaVersionT version = { 'A', 1, 1 }; +void sigintr_handler (int signum) { + exit (0); +} + + int main (void) { SaAmfHandleT handle; int result; @@ -240,6 +247,7 @@ int main (void) { fd_set read_fds; SaNameT compName; + signal (SIGINT, sigintr_handler); result = saAmfInitialize (&handle, &amfCallbacks, &version); if (result != SA_OK) { printf ("initialize result is %d\n", result); diff --git a/test/testamf4.c b/test/testamf4.c index 8e7669f1..145eff72 100644 --- a/test/testamf4.c +++ b/test/testamf4.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -232,6 +234,11 @@ SaAmfCallbacksT amfCallbacks = { SaVersionT version = { 'A', 1, 1 }; +void sigintr_handler (int signum) { + exit (0); +} + + int main (void) { SaAmfHandleT handle; int result; @@ -239,6 +246,8 @@ int main (void) { fd_set read_fds; SaNameT compName; + signal (SIGINT, sigintr_handler); + result = saAmfInitialize (&handle, &amfCallbacks, &version); if (result != SA_OK) { printf ("initialize result is %d\n", result); diff --git a/test/testamf5.c b/test/testamf5.c index fe9a2471..cf8a5b86 100644 --- a/test/testamf5.c +++ b/test/testamf5.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -233,6 +235,10 @@ SaAmfCallbacksT amfCallbacks = { SaVersionT version = { 'A', 1, 1 }; +void sigintr_handler (int signum) { + exit (0); +} + int main (void) { SaAmfHandleT handle; int result; @@ -240,6 +246,7 @@ int main (void) { fd_set read_fds; SaNameT compName; + signal (SIGINT, sigintr_handler); result = saAmfInitialize (&handle, &amfCallbacks, &version); if (result != SA_OK) { printf ("initialize result is %d\n", result); diff --git a/test/testamf6.c b/test/testamf6.c index 706ed135..6d7b960b 100644 --- a/test/testamf6.c +++ b/test/testamf6.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -234,6 +236,10 @@ SaAmfCallbacksT amfCallbacks = { SaVersionT version = { 'A', 1, 1 }; +void sigintr_handler (int signum) { + exit (0); +} + int main (void) { SaAmfHandleT handle; int result; @@ -241,6 +247,8 @@ int main (void) { fd_set read_fds; SaNameT compName; + signal (SIGINT, sigintr_handler); + result = saAmfInitialize (&handle, &amfCallbacks, &version); if (result != SA_OK) { printf ("initialize result is %d\n", result); diff --git a/test/testclm.c b/test/testclm.c index e58d8c09..f2f6934a 100644 --- a/test/testclm.c +++ b/test/testclm.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -133,6 +135,10 @@ SaClmCallbacksT callbacks = { SaVersionT version = { 'A', 1, 1 }; +void sigintr_handler (int signum) { + exit (0); +} + int main (void) { SaClmHandleT handle; fd_set read_fds; @@ -140,6 +146,8 @@ int main (void) { int result; SaClmClusterNotificationT clusterNotificationBuffer[64]; + signal (SIGINT, sigintr_handler); + result = saClmInitialize (&handle, &callbacks, &version); if (result != SA_OK) { printf ("Could not initialize Cluster Membership API instance error %d\n", result);