class ThreadSrpTest : public ::testing::Test
{
public:
+ const char *hostName = "host_name";
thread_instance_h instance;
protected:
{
EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
EXPECT_EQ(THREAD_ERROR_NONE, thread_srp_client_remove_host(instance));
+}
+
+TEST_F(ThreadSrpTest, ClientSetHostNameNotInitialized)
+{
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize());
+ EXPECT_EQ(THREAD_ERROR_NOT_INITIALIZED, thread_srp_client_set_host_name(instance, hostName));
+}
+
+TEST_F(ThreadSrpTest, ClientSetHostNameInvalidParameter)
+{
+ EXPECT_EQ(THREAD_ERROR_INVALID_PARAMETER, thread_srp_client_set_host_name(instance, hostName));
+}
+
+TEST_F(ThreadSrpTest, ClientSetHostNameErrorNone)
+{
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_srp_client_set_host_name(instance, hostName));
}
\ No newline at end of file