--- /dev/null
+/*
+ * 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 <gtest/gtest.h>
+
+#include "thread.h"
+
+#define NETWORK_DATA_SIZE 256
+
+class ThreadNetworkTest : public ::testing::Test
+{
+public:
+ thread_instance_h instance;
+ thread_network_h network;
+ char name[NETWORK_DATA_SIZE + 1];
+ char key[NETWORK_DATA_SIZE + 1];
+ char pskc[NETWORK_DATA_SIZE + 1];
+ uint32_t channel;
+ uint64_t extendedPanId;
+ uint16_t panId;
+
+protected:
+ void SetUp() override
+ {
+ thread_initialize();
+ instance = nullptr;
+ snprintf(name, NETWORK_DATA_SIZE + 1, "Thread-test");
+ snprintf(key, NETWORK_DATA_SIZE + 1, "f780b002ec7d904c9995daaa78a50083");
+ snprintf(pskc, NETWORK_DATA_SIZE + 1, "ba473fecdb235d30bd65233e6089ee50");
+ channel = 0x07fff800;
+ extendedPanId = 18446744073709551615;
+ panId = 65535;
+ }
+
+ void TearDown() override
+ {
+ thread_deinitialize();
+ }
+};
+
+TEST_F(ThreadNetworkTest, CreateOperationalNetworkNotInitialized)
+{
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize());
+ EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED,
+ thread_network_create_operational_network(instance, name,
+ key, pskc, channel, extendedPanId, panId, &network));
+}
+
+TEST_F(ThreadNetworkTest, CreateOperationalNetworkInvalidParameter)
+{
+ EXPECT_EQ(THREAD_ERROR_INVALID_PARAMETER,
+ thread_network_create_operational_network(instance, name,
+ key, pskc, channel, extendedPanId, panId, &network));
+}
+
+TEST_F(ThreadNetworkTest, CreateOperationalNetworkErrorNone)
+{
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
+ EXPECT_EQ(THREAD_ERROR_NONE,
+ thread_network_create_operational_network(instance, name,
+ key, pskc, channel, extendedPanId, panId, &network));
+}
\ No newline at end of file