Skip to content

Commit

Permalink
DTLS API test
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Dec 15, 2023
1 parent 08c7d38 commit 83f104b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tst/DtlsApiTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ TEST_F(DtlsApiTest, createCertificateAndKey_Returns_Success)

TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check)
{
PDtlsSession pClient = NULL;
PDtlsSession pClient;
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(STATUS_NULL_ARG, dtlsSessionIsInitFinished(NULL, &isDtlsConnected));
EXPECT_EQ(FALSE, isDtlsConnected);
EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle));
EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient));
EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, NULL));
freeDtlsSession(&pClient);
Expand All @@ -44,7 +45,7 @@ TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check)
TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount)
{
DtlsSessionCallbacks callbacks;
PDtlsSession pClient = NULL;
PDtlsSession pClient;
TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE;
EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle));
EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient));
Expand All @@ -57,10 +58,10 @@ TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount)
TEST_F(DtlsApiTest, dtlsProcessPacket_Api_Check)
{
DtlsSessionCallbacks callbacks;
PDtlsSession pClient = NULL;
PDtlsSession pClient;
INT32 length;
TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE;
EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, &length));
EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(NULL, NULL, &length));
EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle));
EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient));
EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, NULL));
Expand Down

0 comments on commit 83f104b

Please sign in to comment.