Mesh: Add case for Node Reset in mesh unit test 94/240994/1
authorAnupam Roy <anupam.r@samsung.com>
Thu, 13 Aug 2020 10:48:33 +0000 (16:18 +0530)
committerAnupam Roy <anupam.r@samsung.com>
Thu, 13 Aug 2020 10:48:33 +0000 (16:18 +0530)
Change-Id: If709fdab1d6bf0d811139b19af9ca557021ac3e0
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
tests/test/bt_mesh_unit_test.c

index fb9221b..4bba0e1 100644 (file)
@@ -914,6 +914,10 @@ int test_set_params(int test_id, char *param){
                        param_count = 1;
                        TC_PRT("Input param(%d) (device_uuid)", param_index + 1);
                        break;
+               case BT_MESH_UNIT_TEST_FUNCTION_NODE_RESET:
+                       param_count = 1;
+                       TC_PRT("Input param(%d) (Node Handle)", param_index + 1);
+                       break;
                case BT_MESH_UNIT_TEST_FUNCTION_NODE_GET_FEATURES:
                        param_count = 1;
                        TC_PRT("Input param(%d) (Node Handle)", param_index + 1);
@@ -1610,7 +1614,14 @@ int test_input_callback(void *data)
                        break;
                }
                case BT_MESH_UNIT_TEST_FUNCTION_NODE_RESET: {
-                       // TODO: need to implement
+                       bt_mesh_node_h node_h = 0;
+                       if (g_test_param.param_count != 1) {
+                               TC_PRT("Set Input parameter first!");
+                               break;
+                       }
+                       node_h = GUINT_TO_POINTER(strtoul(g_test_param.params[0], NULL, 16));
+                       ret = bt_mesh_node_reset(node_h);
+                       TC_PRT("return %s\n", __bt_get_error_message(ret));
                        break;
                }
                case BT_MESH_UNIT_TEST_FUNCTION_NODE_GET_FEATURES: {