Add core test case for stop 79/272879/1
authorhyunuk.tak <hyunuk.tak@samsung.com>
Tue, 22 Mar 2022 03:52:06 +0000 (12:52 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 28 Mar 2022 01:51:20 +0000 (10:51 +0900)
Change-Id: I7d747ae3af88e4231fff816c93072d3c5f305a94
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
tests/unittest/thread-unittest-core.cpp

index 754c99c..b9e9908 100644 (file)
@@ -79,4 +79,22 @@ TEST_F(ThreadCoreTest, StartErrorNone)
 {
        EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
        EXPECT_EQ(THREAD_ERROR_NONE, thread_start(instance));
+}
+
+TEST_F(ThreadCoreTest, StopNotInitialized)
+{
+       EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize());
+       EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED, thread_stop(instance));
+}
+
+TEST_F(ThreadCoreTest, StopInvalidParameter)
+{
+       EXPECT_EQ(THREAD_ERROR_INVALID_PARAMETER, thread_stop(instance));
+}
+
+TEST_F(ThreadCoreTest, StopErrorNone)
+{
+       EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
+       EXPECT_EQ(THREAD_ERROR_NONE, thread_start(instance));
+       EXPECT_EQ(THREAD_ERROR_NONE, thread_stop(instance));
 }
\ No newline at end of file