diff --git a/tst/DtlsApiTest.cpp b/tst/DtlsApiTest.cpp index 4fb2bb512c..161e7608a0 100644 --- a/tst/DtlsApiTest.cpp +++ b/tst/DtlsApiTest.cpp @@ -26,10 +26,19 @@ TEST_F(DtlsApiTest, createCertificateAndKey_Returns_Success) TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check) { - PDtlsSession pClient = NULL; - BOOL isDtlsConnected = FALSE; - EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, &isDtlsConnected)); - EXPECT_EQ(FALSE, isDtlsConnected); + PDtlsSession pClient = NULL; + BOOL isDtlsConnected = FALSE; + DtlsSessionCallbacks callbacks; + TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; + EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); + EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, &isDtlsConnected)); + EXPECT_EQ(FALSE, isDtlsConnected); + EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); + EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, NULL)); + freeDtlsSession(&pClient); + EXPECT_EQ(NULL, pClient); + timerQueueFree(&timerQueueHandle); + } TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount) @@ -49,7 +58,6 @@ TEST_F(DtlsApiTest, dtlsProcessPacket_Api_Check) { DtlsSessionCallbacks callbacks; PDtlsSession pClient = NULL; - BOOL isDtlsConnected = FALSE; INT32 length; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, &length));