TC: Expand test case for pthread_sigmask() API.
authorLokesh B V <lokesh.bv@partner.samsung.com>
Tue, 18 Jul 2017 14:34:05 +0000 (20:04 +0530)
committerLokesh B V <lokesh.bv@partner.samsung.com>
Tue, 1 Aug 2017 09:52:35 +0000 (15:22 +0530)
Adds test case: invalid signal as input to pthread_sigmask().

Signed-off-by: Lokesh B V <lokesh.bv@partner.samsung.com>
apps/examples/testcase/le_tc/kernel/tc_pthread.c

index 0ac5161..d10987a 100644 (file)
@@ -48,6 +48,7 @@
 #define INTHREAD                0
 #define INMAIN                  1
 #define SIGQUIT                 3
+#define NOSIG                   333
 
 struct mallinfo mem;
 
@@ -1345,6 +1346,9 @@ static void tc_pthread_pthread_sigmask(void)
        sigemptyset(&st_newmask);
        sigaddset(&st_newmask, SIGQUIT);
 
+       ret_chk = pthread_sigmask(NOSIG, &st_newmask, &st_oldmask);
+       TC_ASSERT_EQ("pthread_sigmask", ret_chk, EINVAL);
+
        ret_chk = pthread_sigmask(SIG_BLOCK, &st_newmask, &st_oldmask);
        TC_ASSERT_GEQ("pthread_sigmask", ret_chk, 0);