From: hyunuk.tak Date: Thu, 24 Mar 2022 07:49:21 +0000 (+0900) Subject: Add network test case for removing ip address X-Git-Tag: accepted/tizen/unified/20220914.164046~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F00%2F272900%2F1;p=platform%2Fcore%2Fapi%2Fthread.git Add network test case for removing ip address Change-Id: I992cdb04bebd9cfcf4bb0ba56cd570535a35ae9a Signed-off-by: hyunuk.tak --- diff --git a/tests/unittest/thread-unittest-network.cpp b/tests/unittest/thread-unittest-network.cpp index 27fb9ce..e7ffd5a 100644 --- a/tests/unittest/thread-unittest-network.cpp +++ b/tests/unittest/thread-unittest-network.cpp @@ -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