From: hyunuk.tak Date: Tue, 22 Mar 2022 03:50:27 +0000 (+0900) Subject: Add core test case for enable X-Git-Tag: accepted/tizen/unified/20220914.164046~106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7222f0cd600c89af1efb0438efba41c87a157732;p=platform%2Fcore%2Fapi%2Fthread.git Add core test case for enable Change-Id: I33f535aa291eafc018626e42c140ff4070a1f2d1 Signed-off-by: hyunuk.tak --- diff --git a/tests/unittest/thread-unittest-core.cpp b/tests/unittest/thread-unittest-core.cpp new file mode 100644 index 0000000..e273faa --- /dev/null +++ b/tests/unittest/thread-unittest-core.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "thread.h" + +class ThreadCoreTest : public ::testing::Test +{ +public: + thread_instance_h instance; + +protected: + void SetUp() override + { + thread_initialize(); + instance = nullptr; + } + + void TearDown() override + { + thread_deinitialize(); + } +}; + +TEST_F(ThreadCoreTest, EnableNotInitialized) +{ + EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize()); + EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED, thread_enable(&instance)); +} + +TEST_F(ThreadCoreTest, EnableErrorNone) +{ + EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); +} \ No newline at end of file