Add network test case for removing ip address 00/272900/1
authorhyunuk.tak <hyunuk.tak@samsung.com>
Thu, 24 Mar 2022 07:49:21 +0000 (16:49 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 28 Mar 2022 01:56:59 +0000 (10:56 +0900)
Change-Id: I992cdb04bebd9cfcf4bb0ba56cd570535a35ae9a
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
tests/unittest/thread-unittest-network.cpp

index 27fb9ce..e7ffd5a 100644 (file)
@@ -266,4 +266,24 @@ TEST_F(ThreadNetworkTest, AddIpAddrErrorNone)
        EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
        EXPECT_EQ(THREAD_ERROR_NONE,
                thread_add_ipaddr(instance, ipv6Address));
+}
+
+TEST_F(ThreadNetworkTest, RemoveIpAddrNotInitialized)
+{
+       EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize());
+       EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED,
+               thread_remove_ipaddr(instance, ipv6Address));
+}
+
+TEST_F(ThreadNetworkTest, RemoveIpAddrInvalidParameter)
+{
+       EXPECT_EQ(THREAD_ERROR_INVALID_PARAMETER,
+               thread_remove_ipaddr(instance, ipv6Address));
+}
+
+TEST_F(ThreadNetworkTest, RemoveIpAddrErrorNone)
+{
+       EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
+       EXPECT_EQ(THREAD_ERROR_NONE,
+               thread_remove_ipaddr(instance, ipv6Address));
 }
\ No newline at end of file