From f18bbe2469508bddd3607d533418d7b21645b750 Mon Sep 17 00:00:00 2001 From: "hyunuk.tak" Date: Tue, 22 Mar 2022 15:11:05 +0900 Subject: [PATCH] Add core test case for scan param destroy Change-Id: I2fb9d4c43c26a4f6ee669e6f0b7ecf8dbef1980b Signed-off-by: hyunuk.tak --- tests/unittest/thread-unittest-core.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/unittest/thread-unittest-core.cpp b/tests/unittest/thread-unittest-core.cpp index 4045aeb..aa3bb37 100644 --- a/tests/unittest/thread-unittest-core.cpp +++ b/tests/unittest/thread-unittest-core.cpp @@ -235,4 +235,22 @@ TEST_F(ThreadCoreTest, ScanPramCreateErrorNone) { EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); EXPECT_EQ(THREAD_ERROR_NONE, thread_scan_param_create(instance, 10, &scanParam)); +} + +TEST_F(ThreadCoreTest, ScanPramDestroyNotInitialized) +{ + EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize()); + EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED, thread_scan_param_destroy(instance, scanParam)); +} + +TEST_F(ThreadCoreTest, ScanPramDestroyInvalidParameter) +{ + EXPECT_EQ(THREAD_ERROR_INVALID_PARAMETER, thread_scan_param_destroy(instance, scanParam)); +} + +TEST_F(ThreadCoreTest, ScanPramDestroyErrorNone) +{ + EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_scan_param_create(instance, 10, &scanParam)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_scan_param_destroy(instance, scanParam)); } \ No newline at end of file -- 2.7.4