pthread: Fix TC for pthread_setcanceltype() & pthread_setcancelstate() API
authorVidisha Thapa <thapa.v@samsung.com>
Wed, 13 Sep 2017 07:56:26 +0000 (13:26 +0530)
committerVidisha Thapa <thapa.v@samsung.com>
Wed, 13 Sep 2017 08:08:13 +0000 (13:38 +0530)
This patch fixes the value for old cancellability variable used in the TC for testing.

Signed-off-by: Vidisha Thapa <thapa.v@samsung.com>
apps/examples/testcase/le_tc/kernel/tc_libc_pthread.c
apps/examples/testcase/le_tc/kernel/tc_pthread.c

index dfeb7da..7890c15 100644 (file)
@@ -1253,6 +1253,7 @@ static void tc_libc_pthread_pthread_setcancelstate(void)
 
        state = PTHREAD_CANCEL_DISABLE;
        ret_chk = pthread_setcancelstate(state, &oldstate);
+       TC_ASSERT_EQ("pthread_setcancelstate", ret_chk, OK);
        TC_ASSERT_EQ("pthread_setcancelstate", oldstate, PTHREAD_CANCEL_ENABLE);
 
        TC_SUCCESS_RESULT();
@@ -1278,10 +1279,8 @@ static void tc_libc_pthread_pthread_setcanceltype(void)
        int ret_chk;
 
        type = PTHREAD_CANCEL_ASYNCHRONOUS;
-       oldtype = PTHREAD_CANCEL_DEFERRED;
        ret_chk = pthread_setcanceltype(type, &oldtype);
        TC_ASSERT_EQ("pthread_setcanceltype", ret_chk, OK);
-       TC_ASSERT_EQ("pthread_setcanceltype", oldtype, PTHREAD_CANCEL_ASYNCHRONOUS);
 
        type = PTHREAD_CANCEL_DEFERRED;
        ret_chk = pthread_setcanceltype(type, &oldtype);
index d4fdca0..b2bed04 100644 (file)
@@ -1490,10 +1490,8 @@ static void tc_pthread_pthread_setcanceltype(void)
        int ret_chk;
 
        type = PTHREAD_CANCEL_ASYNCHRONOUS;
-       oldtype = PTHREAD_CANCEL_DEFERRED;
        ret_chk = pthread_setcanceltype(type, &oldtype);
        TC_ASSERT_EQ("pthread_setcanceltype", ret_chk, OK);
-       TC_ASSERT_EQ("pthread_setcanceltype", oldtype, PTHREAD_CANCEL_ASYNCHRONOUS);
 
        type = PTHREAD_CANCEL_DEFERRED;
        ret_chk = pthread_setcanceltype(type, &oldtype);