4 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jihoon Jung <jh8801.jung@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 /*****************************************************************************
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
30 #include <gtest/gtest.h>
31 /*****************************************************************************
33 *****************************************************************************/
36 /*****************************************************************************
38 *****************************************************************************/
39 /*****************************************************************************
41 *****************************************************************************/
42 /*****************************************************************************
43 * Local Functions Definition
44 *****************************************************************************/
46 class UwbManagerTest : public ::testing::Test {
53 void TearDown() override
59 TEST_F(UwbManagerTest, uwb_initialize_Positive)
61 int ret = UWB_ERROR_NONE;
63 ret = uwb_deinitialize();
64 ASSERT_EQ(UWB_ERROR_NONE, ret);
66 ret = uwb_initialize();
67 ASSERT_EQ(UWB_ERROR_NONE, ret);
70 TEST_F(UwbManagerTest, uwb_initialize_Negative)
72 int ret = UWB_ERROR_NONE;
74 ret = uwb_initialize();
75 ASSERT_EQ(UWB_ERROR_ALREADY_INITIALIZED, ret);
78 TEST_F(UwbManagerTest, uwb_deinitialize_Positive)
80 int ret = UWB_ERROR_NONE;
82 ret = uwb_deinitialize();
83 ASSERT_EQ(UWB_ERROR_NONE, ret);
85 ret = uwb_initialize();
86 ASSERT_EQ(UWB_ERROR_NONE, ret);
89 TEST_F(UwbManagerTest, uwb_deinitialize_Negative)
91 int ret = UWB_ERROR_NONE;
93 ret = uwb_deinitialize();
94 ASSERT_EQ(UWB_ERROR_NONE, ret);
96 ret = uwb_deinitialize();
97 ASSERT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
99 ret = uwb_initialize();
100 ASSERT_EQ(UWB_ERROR_NONE, ret);
103 TEST_F(UwbManagerTest, uwb_reset_Positive)
105 int ret = UWB_ERROR_NONE;
109 ASSERT_EQ(UWB_ERROR_NONE, ret);
112 TEST_F(UwbManagerTest, uwb_reset_Negative)
114 int ret = UWB_ERROR_NONE;
116 ret = uwb_deinitialize();
117 ASSERT_EQ(UWB_ERROR_NONE, ret);
120 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
122 ret = uwb_initialize();
123 ASSERT_EQ(UWB_ERROR_NONE, ret);
126 TEST_F(UwbManagerTest, uwb_factory_reset_Positive)
128 int ret = UWB_ERROR_NONE;
130 ret = uwb_factory_reset();
132 ASSERT_EQ(UWB_ERROR_NONE, ret);
135 TEST_F(UwbManagerTest, uwb_factory_reset_Negative)
137 int ret = UWB_ERROR_NONE;
139 ret = uwb_deinitialize();
140 ASSERT_EQ(UWB_ERROR_NONE, ret);
142 ret = uwb_factory_reset();
143 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
145 ret = uwb_initialize();
146 ASSERT_EQ(UWB_ERROR_NONE, ret);
149 void __uwb_message_received_cb(uint64_t node_id, const unsigned char *message,
150 int message_length, void *user_data)
155 TEST_F(UwbManagerTest, uwb_set_message_received_cb_Positive)
157 int ret = UWB_ERROR_NONE;
159 ret = uwb_set_message_received_cb(__uwb_message_received_cb, NULL);
161 ASSERT_EQ(UWB_ERROR_NONE, ret);
164 TEST_F(UwbManagerTest, uwb_set_message_received_cb_Negative)
166 int ret = UWB_ERROR_NONE;
168 ret = uwb_set_message_received_cb(NULL, NULL);
169 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
172 void __uwb_position_changed_cb(uint64_t node_id, int x, int y, int z,
178 TEST_F(UwbManagerTest, uwb_set_position_changed_cb_Positive)
180 int ret = UWB_ERROR_NONE;
182 ret = uwb_set_position_changed_cb(__uwb_position_changed_cb, NULL);
184 ASSERT_EQ(UWB_ERROR_NONE, ret);
187 TEST_F(UwbManagerTest, uwb_set_position_changed_cb_Negative)
189 int ret = UWB_ERROR_NONE;
191 ret = uwb_set_position_changed_cb(NULL, NULL);
192 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
195 TEST_F(UwbManagerTest, uwb_unset_message_received_cb_Positive)
197 int ret = UWB_ERROR_NONE;
199 ret = uwb_unset_message_received_cb();
201 ASSERT_EQ(UWB_ERROR_NONE, ret);
204 TEST_F(UwbManagerTest, uwb_unset_position_changed_cb_Positive)
206 int ret = UWB_ERROR_NONE;
208 ret = uwb_unset_position_changed_cb();
210 ASSERT_EQ(UWB_ERROR_NONE, ret);
213 TEST_F(UwbManagerTest, uwb_get_own_node_Positive)
215 int ret = UWB_ERROR_NONE;
216 uwb_node_h own_node = NULL;
218 ret = uwb_get_own_node(&own_node);
220 if (own_node != NULL)
221 uwb_node_destroy(own_node);
223 ASSERT_EQ(UWB_ERROR_NONE, ret);
226 TEST_F(UwbManagerTest, uwb_get_own_node_Negative1)
228 int ret = UWB_ERROR_NONE;
230 ret = uwb_deinitialize();
231 ASSERT_EQ(UWB_ERROR_NONE, ret);
233 ret = uwb_get_own_node(NULL);
234 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
236 ret = uwb_initialize();
237 ASSERT_EQ(UWB_ERROR_NONE, ret);
240 TEST_F(UwbManagerTest, uwb_get_own_node_Negative2)
242 int ret = UWB_ERROR_NONE;
244 ret = uwb_get_own_node(NULL);
245 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
249 uwb_network_h _network;
251 void __uwb_network_get_finished_cb(int result, uwb_network_h network, void *user_data)
253 uwb_network_clone(network, &_network);
255 uwb_network_destroy(network);
257 g_main_loop_quit(tc_loop);
261 class UwbNetworkTest : public ::testing::Test {
263 void SetUp() override
267 tc_loop = g_main_loop_new(NULL, FALSE);
269 uwb_get_network(__uwb_network_get_finished_cb, NULL);
271 g_main_loop_run(tc_loop);
274 void TearDown() override
285 void __uwb_network_get_finished_cb2(int result, uwb_network_h network, void *user_data)
287 g_main_loop_quit(tc_loop2);
290 TEST_F(UwbNetworkTest, uwb_network_get_Positive)
292 int ret = UWB_ERROR_NONE;
294 tc_loop2 = g_main_loop_new(NULL, FALSE);
296 ret = uwb_get_network(__uwb_network_get_finished_cb2, NULL);
298 g_main_loop_run(tc_loop2);
300 ASSERT_EQ(UWB_ERROR_NONE, ret);
303 TEST_F(UwbNetworkTest, uwb_network_get_Negative1)
305 int ret = UWB_ERROR_NONE;
307 ret = uwb_deinitialize();
308 ASSERT_EQ(UWB_ERROR_NONE, ret);
310 ret = uwb_get_network(NULL, NULL);
311 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
313 ret = uwb_initialize();
314 ASSERT_EQ(UWB_ERROR_NONE, ret);
317 TEST_F(UwbNetworkTest, uwb_network_get_Negative2)
319 int ret = UWB_ERROR_NONE;
321 ret = uwb_get_network(NULL, NULL);
322 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
325 TEST_F(UwbNetworkTest, uwb_network_clone_Positive)
327 int ret = UWB_ERROR_NONE;
329 uwb_node_h network = NULL;
331 ret = uwb_network_clone(_network, &network);
332 ASSERT_TRUE(network != NULL);
334 uwb_network_destroy(network);
335 ASSERT_EQ(UWB_ERROR_NONE, ret);
338 TEST_F(UwbNetworkTest, uwb_network_clone_Negative)
340 int ret = UWB_ERROR_NONE;
342 ret = uwb_network_clone(NULL, NULL);
343 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
346 TEST_F(UwbNetworkTest, uwb_network_destroy_Positive)
348 int ret = UWB_ERROR_NONE;
350 uwb_node_h network = NULL;
352 uwb_network_clone(_network, &network);
353 ASSERT_TRUE(network != NULL);
355 ret = uwb_network_destroy(network);
356 ASSERT_EQ(UWB_ERROR_NONE, ret);
359 TEST_F(UwbNetworkTest, uwb_network_destroy_Negative)
361 int ret = UWB_ERROR_NONE;
363 ret = uwb_network_destroy(NULL);
364 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
367 TEST_F(UwbNetworkTest, uwb_network_get_pan_id_Positive)
369 int ret = UWB_ERROR_NONE;
372 ret = uwb_network_get_pan_id(_network, &pan_id);
374 ASSERT_EQ(UWB_ERROR_NONE, ret);
377 TEST_F(UwbNetworkTest, uwb_network_get_pan_id_Negative)
379 int ret = UWB_ERROR_NONE;
381 ret = uwb_network_get_pan_id(NULL, NULL);
382 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
385 TEST_F(UwbNetworkTest, uwb_network_get_remote_node_count_Positive)
387 int ret = UWB_ERROR_NONE;
388 int remote_node_count = 0;
390 ret = uwb_network_get_remote_node_count(_network, &remote_node_count);
392 ASSERT_EQ(UWB_ERROR_NONE, ret);
395 TEST_F(UwbNetworkTest, uwb_network_get_remote_node_count_Negative)
397 int ret = UWB_ERROR_NONE;
399 ret = uwb_network_get_remote_node_count(NULL, NULL);
400 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
403 bool __uwb_network_foreach_remote_node_cb(uwb_node_h remote_node, void *user_data)
408 TEST_F(UwbNetworkTest, uwb_network_foreach_remote_node_Positive)
410 int ret = UWB_ERROR_NONE;
412 ret = uwb_network_foreach_remote_node(_network, __uwb_network_foreach_remote_node_cb, NULL);
414 ASSERT_EQ(UWB_ERROR_NONE, ret);
417 TEST_F(UwbNetworkTest, uwb_network_foreach_remote_node_Negative)
419 int ret = UWB_ERROR_NONE;
421 ret = uwb_network_foreach_remote_node(NULL, NULL, NULL);
422 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
425 class UwbNodeTest : public ::testing::Test {
427 void SetUp() override
431 uwb_get_own_node(&_node);
433 strncpy(_key_int32, "TEMP", sizeof(_key_int32));
434 strncpy(_key_int64, "NETWORK_TIMEOUT", sizeof(_key_int64));
435 strncpy(_key_string, "MODE", sizeof(_key_string));
438 void TearDown() override
443 char _key_int32[1024] = {0,};
444 char _key_int64[1024] = {0,};
445 char _key_string[1024] = {0,};
449 TEST_F(UwbNodeTest, uwb_node_clone_Positive)
451 int ret = UWB_ERROR_NONE;
452 uwb_node_h node = NULL;
454 ret = uwb_node_clone(_node, &node);
455 ASSERT_TRUE(node != NULL);
457 uwb_node_destroy(node);
458 ASSERT_EQ(UWB_ERROR_NONE, ret);
461 TEST_F(UwbNodeTest, uwb_node_clone_Negative)
463 int ret = UWB_ERROR_NONE;
465 ret = uwb_node_clone(NULL, NULL);
466 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
469 TEST_F(UwbNodeTest, uwb_node_destroy_Positive)
471 int ret = UWB_ERROR_NONE;
472 uwb_node_h node = NULL;
474 uwb_get_own_node(&node);
475 ASSERT_TRUE(node != NULL);
477 ret = uwb_node_destroy(node);
478 ASSERT_EQ(UWB_ERROR_NONE, ret);
481 TEST_F(UwbNodeTest, uwb_node_destroy_Negative)
483 int ret = UWB_ERROR_NONE;
485 ret = uwb_node_destroy(NULL);
486 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
489 TEST_F(UwbNodeTest, uwb_node_get_distance_Positive)
491 int ret = UWB_ERROR_NONE;
494 ret = uwb_node_get_distance(_node, &distance);
495 ASSERT_EQ(UWB_ERROR_NONE, ret);
498 TEST_F(UwbNodeTest, uwb_node_get_distance_Negative)
500 int ret = UWB_ERROR_NONE;
502 ret = uwb_node_get_distance(NULL, NULL);
503 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
506 TEST_F(UwbNodeTest, uwb_node_get_node_id_Positive)
508 int ret = UWB_ERROR_NONE;
509 uint64_t node_id = 0;
511 ret = uwb_node_get_node_id(_node, &node_id);
512 ASSERT_EQ(UWB_ERROR_NONE, ret);
515 TEST_F(UwbNodeTest, uwb_node_get_node_id_Negative)
517 int ret = UWB_ERROR_NONE;
519 ret = uwb_node_get_node_id(NULL, NULL);
520 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
523 TEST_F(UwbNodeTest, uwb_node_get_pan_id_Positive)
525 int ret = UWB_ERROR_NONE;
528 ret = uwb_node_get_pan_id(_node, &pan_id);
529 ASSERT_EQ(UWB_ERROR_NONE, ret);
532 TEST_F(UwbNodeTest, uwb_node_get_pan_id_Negative)
534 int ret = UWB_ERROR_NONE;
536 ret = uwb_node_get_pan_id(NULL, NULL);
537 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
540 TEST_F(UwbNodeTest, uwb_node_get_is_remote_Positive)
542 int ret = UWB_ERROR_NONE;
543 bool is_remote = false;
545 ret = uwb_node_get_is_remote(_node, &is_remote);
546 ASSERT_EQ(UWB_ERROR_NONE, ret);
549 TEST_F(UwbNodeTest, uwb_node_get_is_remote_Negative)
551 int ret = UWB_ERROR_NONE;
553 ret = uwb_node_get_is_remote(NULL, NULL);
554 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
557 TEST_F(UwbNodeTest, uwb_node_get_position_Positive)
559 int ret = UWB_ERROR_NONE;
564 ret = uwb_node_get_position(_node, &x, &y, &z);
566 ASSERT_EQ(UWB_ERROR_NONE, ret);
569 TEST_F(UwbNodeTest, uwb_node_get_position_Negative)
571 int ret = UWB_ERROR_NONE;
573 ret = uwb_node_get_position(NULL, NULL, NULL, NULL);
574 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
577 TEST_F(UwbNodeTest, uwb_node_set_position_Positive)
579 int ret = UWB_ERROR_NONE;
581 ret = uwb_node_set_position(_node, 1, 2, 3);
583 ASSERT_EQ(UWB_ERROR_NONE, ret);
586 TEST_F(UwbNodeTest, uwb_node_set_position_Negative1)
588 int ret = UWB_ERROR_NONE;
590 ret = uwb_deinitialize();
591 ASSERT_EQ(UWB_ERROR_NONE, ret);
593 ret = uwb_node_set_position(NULL, 0, 0, 0);
594 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
596 ret = uwb_initialize();
597 ASSERT_EQ(UWB_ERROR_NONE, ret);
600 TEST_F(UwbNodeTest, uwb_node_set_position_Negative2)
602 int ret = UWB_ERROR_NONE;
604 ret = uwb_node_set_position(NULL, 0, 0, 0);
605 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
608 TEST_F(UwbNodeTest, uwb_node_send_message_Positive)
610 int ret = UWB_ERROR_NONE;
611 const unsigned char message[1024] = {0x00, 0x01, 0x02};
613 ret = uwb_node_send_message(message, sizeof(message));
615 ASSERT_EQ(UWB_ERROR_NONE, ret);
618 TEST_F(UwbNodeTest, uwb_node_send_message_Negative1)
620 int ret = UWB_ERROR_NONE;
622 ret = uwb_deinitialize();
623 ASSERT_EQ(UWB_ERROR_NONE, ret);
625 ret = uwb_node_send_message(NULL, 0);
626 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
628 ret = uwb_initialize();
629 ASSERT_EQ(UWB_ERROR_NONE, ret);
632 TEST_F(UwbNodeTest, uwb_node_send_message_Negative2)
634 int ret = UWB_ERROR_NONE;
636 ret = uwb_node_send_message(NULL, 0);
637 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
640 TEST_F(UwbNodeTest, uwb_node_send_message_to_Positive)
642 int ret = UWB_ERROR_NONE;
643 const unsigned char message[1024] = {0x00, 0x01, 0x02};
645 ret = uwb_node_send_message_to(_node, message, sizeof(message));
647 ASSERT_EQ(UWB_ERROR_NONE, ret);
650 TEST_F(UwbNodeTest, uwb_node_send_message_to_Negative1)
652 int ret = UWB_ERROR_NONE;
654 ret = uwb_deinitialize();
655 ASSERT_EQ(UWB_ERROR_NONE, ret);
657 ret = uwb_node_send_message_to(NULL, NULL, 0);
658 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
660 ret = uwb_initialize();
661 ASSERT_EQ(UWB_ERROR_NONE, ret);
664 TEST_F(UwbNodeTest, uwb_node_send_message_to_Negative2)
666 int ret = UWB_ERROR_NONE;
668 ret = uwb_node_send_message_to(NULL, NULL, 0);
669 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
672 TEST_F(UwbNodeTest, uwb_node_get_configuration_int32_Positive)
674 int ret = UWB_ERROR_NONE;
678 ret = uwb_node_get_configuration_int32(_node, _key_int32, &value);
680 ASSERT_EQ(UWB_ERROR_NONE, ret);
683 TEST_F(UwbNodeTest, uwb_node_get_configuration_int32_Negative1)
685 int ret = UWB_ERROR_NONE;
687 ret = uwb_deinitialize();
688 ASSERT_EQ(UWB_ERROR_NONE, ret);
690 ret = uwb_node_get_configuration_int32(NULL, NULL, NULL);
691 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
693 ret = uwb_initialize();
694 ASSERT_EQ(UWB_ERROR_NONE, ret);
697 TEST_F(UwbNodeTest, uwb_node_get_configuration_int32_Negative2)
699 int ret = UWB_ERROR_NONE;
701 ret = uwb_node_get_configuration_int32(NULL, NULL, NULL);
702 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
705 TEST_F(UwbNodeTest, uwb_node_set_configuration_int32_Positive)
707 int ret = UWB_ERROR_NONE;
709 ret = uwb_node_set_configuration_int32(_node, _key_int32, 0);
711 ASSERT_EQ(UWB_ERROR_NONE, ret);
714 TEST_F(UwbNodeTest, uwb_node_set_configuration_int32_Negative1)
716 int ret = UWB_ERROR_NONE;
718 ret = uwb_deinitialize();
719 ASSERT_EQ(UWB_ERROR_NONE, ret);
721 ret = uwb_node_set_configuration_int32(NULL, NULL, 0);
722 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
724 ret = uwb_initialize();
725 ASSERT_EQ(UWB_ERROR_NONE, ret);
728 TEST_F(UwbNodeTest, uwb_node_set_configuration_int32_Negative2)
730 int ret = UWB_ERROR_NONE;
732 ret = uwb_node_set_configuration_int32(NULL, NULL, 0);
733 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
736 TEST_F(UwbNodeTest, uwb_node_get_configuration_int64_Positive)
738 int ret = UWB_ERROR_NONE;
741 ret = uwb_node_get_configuration_int64(_node, _key_int64, &value);
743 ASSERT_EQ(UWB_ERROR_NONE, ret);
746 TEST_F(UwbNodeTest, uwb_node_get_configuration_int64_Negative1)
748 int ret = UWB_ERROR_NONE;
750 ret = uwb_deinitialize();
751 ASSERT_EQ(UWB_ERROR_NONE, ret);
753 ret = uwb_node_get_configuration_int64(NULL, NULL, NULL);
754 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
756 ret = uwb_initialize();
757 ASSERT_EQ(UWB_ERROR_NONE, ret);
760 TEST_F(UwbNodeTest, uwb_node_get_configuration_int64_Negative2)
762 int ret = UWB_ERROR_NONE;
764 ret = uwb_node_get_configuration_int64(NULL, NULL, NULL);
765 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
768 TEST_F(UwbNodeTest, uwb_node_set_configuration_int64_Positive)
770 int ret = UWB_ERROR_NONE;
772 ret = uwb_node_set_configuration_int64(_node, _key_int64, 0);
774 ASSERT_EQ(UWB_ERROR_NONE, ret);
777 TEST_F(UwbNodeTest, uwb_node_set_configuration_int64_Negative1)
779 int ret = UWB_ERROR_NONE;
781 ret = uwb_deinitialize();
782 ASSERT_EQ(UWB_ERROR_NONE, ret);
784 ret = uwb_node_set_configuration_int64(NULL, NULL, 0);
785 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
787 ret = uwb_initialize();
788 ASSERT_EQ(UWB_ERROR_NONE, ret);
791 TEST_F(UwbNodeTest, uwb_node_set_configuration_int64_Negative2)
793 int ret = UWB_ERROR_NONE;
795 ret = uwb_node_set_configuration_int64(NULL, NULL, 0);
796 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
799 TEST_F(UwbNodeTest, uwb_node_get_configuration_string_Positive)
801 int ret = UWB_ERROR_NONE;
804 ret = uwb_node_get_configuration_string(_node, _key_string, &value);
809 ASSERT_EQ(UWB_ERROR_NONE, ret);
812 TEST_F(UwbNodeTest, uwb_node_get_configuration_string_Negative1)
814 int ret = UWB_ERROR_NONE;
816 ret = uwb_deinitialize();
817 ASSERT_EQ(UWB_ERROR_NONE, ret);
819 ret = uwb_node_get_configuration_string(NULL, NULL, NULL);
820 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
822 ret = uwb_initialize();
823 ASSERT_EQ(UWB_ERROR_NONE, ret);
826 TEST_F(UwbNodeTest, uwb_node_get_configuration_string_Negative2)
828 int ret = UWB_ERROR_NONE;
830 ret = uwb_node_get_configuration_string(NULL, NULL, NULL);
831 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
834 TEST_F(UwbNodeTest, uwb_node_set_configuration_string_Positive)
836 int ret = UWB_ERROR_NONE;
837 char conf_str[1024] = {0,};
839 strncpy(conf_str, "HELLO", sizeof(conf_str));
841 ret = uwb_node_set_configuration_string(_node, _key_string, (const char *)conf_str);
843 ASSERT_EQ(UWB_ERROR_NONE, ret);
846 TEST_F(UwbNodeTest, uwb_node_set_configuration_string_Negative1)
848 int ret = UWB_ERROR_NONE;
850 ret = uwb_deinitialize();
851 ASSERT_EQ(UWB_ERROR_NONE, ret);
853 ret = uwb_node_set_configuration_string(NULL, NULL, NULL);
854 EXPECT_EQ(UWB_ERROR_NOT_INITIALIZED, ret);
856 ret = uwb_initialize();
857 ASSERT_EQ(UWB_ERROR_NONE, ret);
860 TEST_F(UwbNodeTest, uwb_node_set_configuration_string_Negative2)
862 int ret = UWB_ERROR_NONE;
864 ret = uwb_node_set_configuration_string(NULL, NULL, NULL);
865 ASSERT_EQ(UWB_ERROR_INVALID_PARAMETER, ret);
868 int main(int argc, char **argv)
870 ::testing::InitGoogleTest(&argc, argv);
871 return RUN_ALL_TESTS();