From 88f9540041afcfd47090c9f3881ba5b1adf81101 Mon Sep 17 00:00:00 2001 From: "hyunuk.tak" Date: Thu, 24 Mar 2022 16:49:21 +0900 Subject: [PATCH] Add network test case for removing ip address Change-Id: I992cdb04bebd9cfcf4bb0ba56cd570535a35ae9a Signed-off-by: hyunuk.tak --- tests/unittest/thread-unittest-network.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 -- 2.34.1