2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <gtest/gtest.h>
21 class ThreadSrpTest : public ::testing::Test
24 thread_instance_h instance;
33 void TearDown() override
36 thread_disable(instance);
37 thread_deinitialize();
41 TEST_F(ThreadSrpTest, ClientStartNotInitialized)
43 EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize());
44 EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED, thread_srp_client_start(instance));
47 TEST_F(ThreadSrpTest, ClientStartInvalidParameter)
49 EXPECT_EQ(THREAD_ERROR_INVALID_PARAMETER, thread_srp_client_start(instance));
52 TEST_F(ThreadSrpTest, ClientStartErrorNone)
54 EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
55 EXPECT_EQ(THREAD_ERROR_NONE, thread_srp_client_start(instance));