From: Jaehong Jo Date: Mon, 10 Oct 2016 10:08:30 +0000 (+0900) Subject: Remove Disabled TC in CA layer. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18d2fb28b793e9eb3319002126d5d5df76833561;p=contrib%2Fiotivity.git Remove Disabled TC in CA layer. Because this should no longer be a valid test. Change-Id: I739aeafda6b9b86ac298247c19c7ad37dde89c3e Signed-off-by: Jaehong Jo Reviewed-on: https://gerrit.iotivity.org/gerrit/13035 Tested-by: jenkins-iotivity Reviewed-by: Dave Thaler Reviewed-by: Jaewook Jung Reviewed-by: Hyuna Jo Reviewed-by: Ziran Sun --- diff --git a/resource/csdk/connectivity/test/ca_api_unittest.cpp b/resource/csdk/connectivity/test/ca_api_unittest.cpp index c2e5fff..72765a7 100644 --- a/resource/csdk/connectivity/test/ca_api_unittest.cpp +++ b/resource/csdk/connectivity/test/ca_api_unittest.cpp @@ -288,39 +288,6 @@ TEST_F(CATests, SendRequestTestWithInvalidAddress) } // CASendRequest TC -TEST(SendRequestTest, DISABLED_TC_16_Positive_01) -{ - addr = (char *) ADDRESS; - CACreateEndpoint(CA_DEFAULT_FLAGS, CA_ADAPTER_IP, addr, PORT, &tempRep); - - memset(&requestData, 0, sizeof(CAInfo_t)); - CAGenerateToken(&tempToken, tokenLength); - requestData.token = tempToken; - requestData.tokenLength = tokenLength; - - int length = strlen(NORMAL_INFO_DATA) + strlen("a/light"); - requestData.payload = (CAPayload_t) calloc(length, sizeof(char)); - if(!requestData.payload) - { - CADestroyToken(tempToken); - FAIL() << "requestData.payload allocation failed"; - } - snprintf((char*)requestData.payload, length, NORMAL_INFO_DATA, "a/light"); - requestData.payloadSize = length + 1; - requestData.type = CA_MSG_NONCONFIRM; - - memset(&requestInfo, 0, sizeof(CARequestInfo_t)); - requestInfo.method = CA_GET; - requestInfo.info = requestData; - - EXPECT_EQ(CA_STATUS_OK, CASendRequest(tempRep, &requestInfo)); - - CADestroyToken(tempToken); - CADestroyEndpoint(tempRep); - free(requestData.payload); - tempRep = NULL; -} - // check return value when a NULL is passed instead of a valid CARequestInfo_t address TEST_F(CATests, SendRequestTestWithNullAddr) { @@ -333,6 +300,7 @@ TEST_F(CATests, SendRequestTestWithNullAddr) tempRep = NULL; } +// CASendResponse TC TEST_F(CATests, SendResponseTestWithInvalidCode) { EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP)); @@ -367,82 +335,6 @@ TEST_F(CATests, SendResponseTestWithInvalidCode) } } -// CASendResponse TC -TEST(SendResponseTest, DISABLED_TC_19_Positive_01) -{ - addr = (char *) ADDRESS; - CACreateEndpoint(CA_DEFAULT_FLAGS, CA_ADAPTER_IP, addr, PORT, &tempRep); - - memset(&responseData, 0, sizeof(CAInfo_t)); - responseData.type = CA_MSG_NONCONFIRM; - responseData.messageId = 1; - responseData.payload = (CAPayload_t)malloc(sizeof("response payload")); - responseData.dataType = CA_RESPONSE_DATA; - - EXPECT_TRUE(responseData.payload != NULL); - if(!responseData.payload) - { - CADestroyEndpoint(tempRep); - return; - } - - memcpy(responseData.payload, "response payload", sizeof("response payload")); - responseData.payloadSize = sizeof("response payload"); - - CAGenerateToken(&tempToken, tokenLength); - requestData.token = tempToken; - requestData.tokenLength = tokenLength; - - memset(&responseInfo, 0, sizeof(CAResponseInfo_t)); - responseInfo.result = CA_CONTENT; - responseInfo.info = responseData; - - EXPECT_EQ(CA_STATUS_OK, CASendResponse(tempRep, &responseInfo)); - - CADestroyToken(tempToken); - CADestroyEndpoint(tempRep); - free(responseData.payload); - tempRep = NULL; -} - -// check return value when address is NULL as multicast -TEST(SendResponseTest, DISABLED_TC_20_Negative_01) -{ - addr = NULL; - CACreateEndpoint(CA_DEFAULT_FLAGS, CA_ADAPTER_IP, addr, 0, &tempRep); - - memset(&responseData, 0, sizeof(CAInfo_t)); - responseData.type = CA_MSG_NONCONFIRM; - responseData.messageId = 1; - responseData.payload = (CAPayload_t)malloc(sizeof("response payload")); - responseData.dataType = CA_RESPONSE_DATA; - EXPECT_TRUE(responseData.payload != NULL); - - if(!responseData.payload) - { - CADestroyEndpoint(tempRep); - return; - } - - memcpy(responseData.payload, "response payload", sizeof("response payload")); - responseData.payloadSize = sizeof("response payload"); - - CAGenerateToken(&tempToken, tokenLength); - requestData.token = tempToken; - requestData.tokenLength = tokenLength; - - memset(&responseInfo, 0, sizeof(CAResponseInfo_t)); - responseInfo.result = CA_CONTENT; - responseInfo.info = responseData; - - EXPECT_EQ(CA_STATUS_OK, CASendResponse(tempRep, &responseInfo)); - - CADestroyToken(tempToken); - CADestroyEndpoint(tempRep); - free (responseData.payload); - tempRep = NULL; -} - // check return value NULL is passed instead of a valid CAResponseInfo_t address TEST_F(CATests, SendResponseTest) { diff --git a/resource/csdk/connectivity/test/octhread_tests.cpp b/resource/csdk/connectivity/test/octhread_tests.cpp index d624af6..670bed9 100644 --- a/resource/csdk/connectivity/test/octhread_tests.cpp +++ b/resource/csdk/connectivity/test/octhread_tests.cpp @@ -506,33 +506,6 @@ TEST(ConditionTests, TC_05_WAIT) ca_thread_pool_free(mythreadpool); } -// Disabled because this should no longer be a valid test -TEST(ConditionTests, DISABLED_TC_06_INVALIDWAIT) -{ - - oc_mutex sharedMutex = oc_mutex_new(); - oc_cond sharedCond = oc_cond_new(); - - oc_mutex_lock(sharedMutex); - - int ret = oc_cond_wait_for(NULL, sharedMutex, 5000); - EXPECT_EQ(OC_WAIT_INVAL,ret); - - ret = oc_cond_wait_for(sharedCond, NULL, 5000); - EXPECT_EQ(OC_WAIT_INVAL,ret); - - ret = oc_cond_wait_for(NULL, NULL, 5000); - EXPECT_EQ(OC_WAIT_INVAL,ret); - - oc_mutex_unlock(sharedMutex); - - // Cleanup Everything - - oc_mutex_free(sharedMutex); - - oc_cond_free(sharedCond); -} - TEST(ConditionTests, TC_07_WAITDURATION) { const double TARGET_WAIT = 1.125;