[UTC/ITC][nnstreamer][ACR-1572] Add g_free() after calling ml_tensors_info_get_tensor... 31/239531/2
authorSangjung Woo <sangjung.woo@samsung.com>
Mon, 27 Jul 2020 10:12:27 +0000 (19:12 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Tue, 28 Jul 2020 10:06:43 +0000 (19:06 +0900)
Since the behavior of ml_tensors_info_get_tensor_name() is changed, this
patch updates the related test cases.

Change-Id: Ia0b4fe48ed4d355d651aa0f00dc35a8ebb84fb63
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
src/itc/nnstreamer/ITs-nnstreamer-tensors.c
src/utc/nnstreamer/utc-nnstreamer-pipeline-tensor-info.c
src/utc/nnstreamer/utc-nnstreamer-scenario.c

index 7f5a21f75560670dc772d591c4a44ce177e5d3a1..6be328e47400b0c7c598ef325f94b5f5dadd68cb 100755 (executable)
@@ -309,12 +309,15 @@ int ITc_nnstreamer_tensors_ml_tensors_info_set_get_tensor_name_p(void)
                FPRINTF("[%s:%d] Set Value  %s and Get value  %sof tensor name is not same\\n", __FILE__, __LINE__, "tensor-name-test", pszGetTensorName);
                nRet = ml_tensors_info_destroy (hTensorinfoHandle);
                PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_tensors_info_destroy", NnStreamerGetError(nRet));
+               g_free (pszGetTensorName);
                return 1;
        }
 
        nRet = ml_tensors_info_destroy (hTensorinfoHandle);
        PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_tensors_info_destroy", NnStreamerGetError(nRet));
 
+       g_free (pszGetTensorName);
+
        return 0;
 }
 
index eed0329f97682036c15824bfa797b31f328aa3f4..9af383c6b7cb3e3b3f6c7d2c36a439b1baa9f5bc 100644 (file)
@@ -356,6 +356,8 @@ int utc_ml_tensors_info_get_tensor_name_p (void)
   status = ml_tensors_info_destroy (info);
   assert_eq (status, ML_ERROR_NONE);
 
+  g_free (out_name);
+
   return 0;
 }
 
index 5a9a22aad6ff459437b420a5e2d3e7e70dc2f2b7..2e31f99be13d4be112b73272566fa06f8cf1d914 100644 (file)
@@ -1176,6 +1176,7 @@ int utc_nnstreamer_scenario_check_tensor_info_utilities_p (void)
   status = ml_tensors_info_get_tensor_name (info, 1, &out_name);
   assert_eq (status, ML_ERROR_NONE);
   assert (out_name && g_str_equal (out_name, "tensor-name-test"));
+  g_free (out_name);
 
   status = ml_tensors_info_get_tensor_type (info, 2, &out_type);
   assert_eq (status, ML_ERROR_INVALID_PARAMETER);