[Custom] handle for custom connection accepted/tizen_unified_x_asan accepted/tizen/unified/20250108.103324 accepted/tizen/unified/x/20250108.225140 accepted/tizen/unified/x/asan/20250211.003228
authorJaeyun Jung <jy1210.jung@samsung.com>
Thu, 2 Jan 2025 06:41:06 +0000 (15:41 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Mon, 6 Jan 2025 08:35:37 +0000 (17:35 +0900)
Define handle for custom connection to hide internal structure.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
src/libnnstreamer-edge/nnstreamer-edge-custom-impl.c
src/libnnstreamer-edge/nnstreamer-edge-custom-impl.h
src/libnnstreamer-edge/nnstreamer-edge-internal.c
tests/unittest_nnstreamer-edge-custom.cc

index 08352d4d8289b1854ed86d4eca8b594722685cab..da91531623100be4346b27eb373d924fa74bd71a 100644 (file)
 #include "nnstreamer-edge-log.h"
 #include "nnstreamer-edge-util.h"
 
+/**
+ * @brief Internal data structure for edge custom connection.
+ */
+typedef struct
+{
+  void *dl_handle;
+  nns_edge_custom_s *instance;
+  void *priv;
+} custom_connection_s;
+
 typedef const nns_edge_custom_s *custom_get_instance (void);
 
 /**
@@ -65,17 +75,25 @@ error:
  * @brief Internal function to load custom connection from library.
  */
 int
-nns_edge_custom_load (custom_connection_s * custom, const char *lib_path)
+nns_edge_custom_load (const char *lib_path,
+    nns_edge_custom_connection_h * handle)
 {
+  custom_connection_s *custom;
   nns_edge_custom_s *custom_h;
   int ret;
 
   if (!STR_IS_VALID (lib_path))
     return NNS_EDGE_ERROR_INVALID_PARAMETER;
 
-  if (!custom)
+  if (!handle)
     return NNS_EDGE_ERROR_INVALID_PARAMETER;
 
+  custom = (custom_connection_s *) calloc (1, sizeof (custom_connection_s));
+  if (!custom) {
+    nns_edge_loge ("Failed to allocate memory for edge custom connection.");
+    return NNS_EDGE_ERROR_OUT_OF_MEMORY;
+  }
+
   ret = _load_custom_library (custom, lib_path);
   if (NNS_EDGE_ERROR_NONE != ret) {
     nns_edge_loge
@@ -91,7 +109,9 @@ nns_edge_custom_load (custom_connection_s * custom, const char *lib_path)
   }
 
 error:
-  if (NNS_EDGE_ERROR_NONE != ret) {
+  if (NNS_EDGE_ERROR_NONE == ret) {
+    *handle = custom;
+  } else {
     nns_edge_custom_release (custom);
   }
 
@@ -102,8 +122,9 @@ error:
  * @brief Internal function to release custom connection.
  */
 int
-nns_edge_custom_release (custom_connection_s * custom)
+nns_edge_custom_release (nns_edge_custom_connection_h handle)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret;
 
@@ -125,6 +146,7 @@ nns_edge_custom_release (custom_connection_s * custom)
   custom->instance = NULL;
   custom->priv = NULL;
 
+  free (custom);
   return ret;
 }
 
@@ -132,8 +154,9 @@ nns_edge_custom_release (custom_connection_s * custom)
  * @brief Internal function to start custom connection.
  */
 int
-nns_edge_custom_start (custom_connection_s * custom)
+nns_edge_custom_start (nns_edge_custom_connection_h handle)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret;
 
@@ -154,8 +177,9 @@ nns_edge_custom_start (custom_connection_s * custom)
  * @brief Internal function to stop custom connection.
  */
 int
-nns_edge_custom_stop (custom_connection_s * custom)
+nns_edge_custom_stop (nns_edge_custom_connection_h handle)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret;
 
@@ -176,9 +200,10 @@ nns_edge_custom_stop (custom_connection_s * custom)
  * @brief Internal function to set the event callback of custom connection.
  */
 int
-nns_edge_custom_set_event_callback (custom_connection_s * custom,
+nns_edge_custom_set_event_callback (nns_edge_custom_connection_h handle,
     nns_edge_event_cb cb, void *user_data)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret;
 
@@ -199,8 +224,9 @@ nns_edge_custom_set_event_callback (custom_connection_s * custom,
  * @brief Internal function to connect custom connection.
  */
 int
-nns_edge_custom_connect (custom_connection_s * custom)
+nns_edge_custom_connect (nns_edge_custom_connection_h handle)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret;
 
@@ -221,8 +247,9 @@ nns_edge_custom_connect (custom_connection_s * custom)
  * @brief Internal function to check custom connection.
  */
 int
-nns_edge_custom_is_connected (custom_connection_s * custom)
+nns_edge_custom_is_connected (nns_edge_custom_connection_h handle)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
 
   if (!custom || !custom->instance)
@@ -237,8 +264,10 @@ nns_edge_custom_is_connected (custom_connection_s * custom)
  * @brief Internal function to send data to custom connection.
  */
 int
-nns_edge_custom_send_data (custom_connection_s * custom, nns_edge_data_h data_h)
+nns_edge_custom_send_data (nns_edge_custom_connection_h handle,
+    nns_edge_data_h data_h)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret;
 
@@ -263,9 +292,10 @@ nns_edge_custom_send_data (custom_connection_s * custom, nns_edge_data_h data_h)
  * @brief Internal function to set information to custom connection.
  */
 int
-nns_edge_custom_set_info (custom_connection_s * custom, const char *key,
+nns_edge_custom_set_info (nns_edge_custom_connection_h handle, const char *key,
     const char *value)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret = NNS_EDGE_ERROR_NOT_SUPPORTED;
 
@@ -291,9 +321,10 @@ nns_edge_custom_set_info (custom_connection_s * custom, const char *key,
  * @brief Internal function to get information from custom connection.
  */
 int
-nns_edge_custom_get_info (custom_connection_s * custom, const char *key,
+nns_edge_custom_get_info (nns_edge_custom_connection_h handle, const char *key,
     char **value)
 {
+  custom_connection_s *custom = (custom_connection_s *) handle;
   nns_edge_custom_s *custom_h;
   int ret = NNS_EDGE_ERROR_NOT_SUPPORTED;
 
index a21301dfc00ee6d0f52e63c225c5dd2f51a612dc..a4332f8d94f049576bd8b8d6c6bff14232c82d89 100644 (file)
 extern "C" {
 #endif /* __cplusplus */
 
-/**
- * @brief Data structure for edge custom connection.
- */
-typedef struct
-{
-  void *dl_handle;
-  nns_edge_custom_s *instance;
-  void *priv;
-} custom_connection_s;
+typedef void *nns_edge_custom_connection_h;
 
 #if defined(ENABLE_CUSTOM_CONNECTION)
 /**
  * @brief Internal function to load custom connection from library.
  */
-int nns_edge_custom_load (custom_connection_s *custom, const char *lib_path);
+int nns_edge_custom_load (const char *lib_path, nns_edge_custom_connection_h *handle);
 
 /**
  * @brief Internal function to release custom connection.
  */
-int nns_edge_custom_release (custom_connection_s *custom);
+int nns_edge_custom_release (nns_edge_custom_connection_h handle);
 
 /**
  * @brief Internal function to start custom connection.
  */
-int nns_edge_custom_start (custom_connection_s *custom);
+int nns_edge_custom_start (nns_edge_custom_connection_h handle);
 
 /**
  * @brief Internal function to stop custom connection.
  */
-int nns_edge_custom_stop (custom_connection_s *custom);
+int nns_edge_custom_stop (nns_edge_custom_connection_h handle);
 
 /**
  * @brief Internal function to set the event callback of custom connection.
  */
-int nns_edge_custom_set_event_callback (custom_connection_s *custom, nns_edge_event_cb cb, void *user_data);
+int nns_edge_custom_set_event_callback (nns_edge_custom_connection_h handle, nns_edge_event_cb cb, void *user_data);
 
 /**
  * @brief Internal function to connect custom connection.
  */
-int nns_edge_custom_connect (custom_connection_s *custom);
+int nns_edge_custom_connect (nns_edge_custom_connection_h handle);
 
 /**
  * @brief Internal function to check custom connection.
  */
-int nns_edge_custom_is_connected (custom_connection_s *custom);
+int nns_edge_custom_is_connected (nns_edge_custom_connection_h handle);
 
 /**
  * @brief Internal function to send data to custom connection.
  */
-int nns_edge_custom_send_data (custom_connection_s *custom, nns_edge_data_h data_h);
+int nns_edge_custom_send_data (nns_edge_custom_connection_h handle, nns_edge_data_h data_h);
 
 /**
  * @brief Internal function to set information to custom connection.
  */
-int nns_edge_custom_set_info (custom_connection_s *custom, const char *key, const char *value);
+int nns_edge_custom_set_info (nns_edge_custom_connection_h handle, const char *key, const char *value);
 
 /**
  * @brief Internal function to get information from custom connection.
  */
-int nns_edge_custom_get_info (custom_connection_s *custom, const char *key, char **value);
+int nns_edge_custom_get_info (nns_edge_custom_connection_h handle, const char *key, char **value);
 #else
 #define nns_edge_custom_load(...) (NNS_EDGE_ERROR_NOT_SUPPORTED)
 #define nns_edge_custom_release(...) (NNS_EDGE_ERROR_NOT_SUPPORTED)
index cde89f7241be8579de3de77e5534af4314166f6c..4aede6323cfa867959fb2cb03e67ab753136c29a 100644 (file)
@@ -75,7 +75,7 @@ typedef struct
   void *broker_h;
 
   /* Data for custom connection */
-  custom_connection_s custom;
+  nns_edge_custom_connection_h custom_connection_h;
 } nns_edge_handle_s;
 
 /**
@@ -919,7 +919,7 @@ _nns_edge_send_thread (void *thread_data)
           nns_edge_loge ("Failed to send data via MQTT connection.");
         break;
       case NNS_EDGE_CONNECT_TYPE_CUSTOM:
-        ret = nns_edge_custom_send_data (&eh->custom, data_h);
+        ret = nns_edge_custom_send_data (eh->custom_connection_h, data_h);
         if (NNS_EDGE_ERROR_NONE != ret)
           nns_edge_loge ("Failed to send data via custom connection.");
         break;
@@ -1296,9 +1296,7 @@ _nns_edge_create_handle (const char *id, nns_edge_node_type_e node_type,
   eh->sending = false;
   eh->listener_fd = -1;
   eh->caps_str = nns_edge_strdup ("");
-  eh->custom.dl_handle = NULL;
-  eh->custom.instance = NULL;
-  eh->custom.priv = NULL;
+  eh->custom_connection_h = NULL;
 
   ret = nns_edge_metadata_create (&eh->metadata);
   if (ret != NNS_EDGE_ERROR_NONE) {
@@ -1355,7 +1353,7 @@ nns_edge_custom_create_handle (const char *id, const char *lib_path,
   eh = (nns_edge_handle_s *) (*edge_h);
   eh->connect_type = NNS_EDGE_CONNECT_TYPE_CUSTOM;
 
-  ret = nns_edge_custom_load (&eh->custom, lib_path);
+  ret = nns_edge_custom_load (lib_path, &eh->custom_connection_h);
   if (ret != NNS_EDGE_ERROR_NONE)
     nns_edge_release_handle (eh);
 
@@ -1427,7 +1425,7 @@ nns_edge_start (nns_edge_h edge_h)
   nns_edge_lock (eh);
 
   if (NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
-    ret = nns_edge_custom_start (&eh->custom);
+    ret = nns_edge_custom_start (eh->custom_connection_h);
     if (NNS_EDGE_ERROR_NONE == ret)
       ret = _nns_edge_create_send_thread (eh);
 
@@ -1536,7 +1534,7 @@ nns_edge_stop (nns_edge_h edge_h)
   }
 
   if (NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
-    ret = nns_edge_custom_stop (&eh->custom);
+    ret = nns_edge_custom_stop (eh->custom_connection_h);
   }
 
   if (NNS_EDGE_ERROR_NONE == ret)
@@ -1600,7 +1598,7 @@ nns_edge_release_handle (nns_edge_h edge_h)
       }
       break;
     case NNS_EDGE_CONNECT_TYPE_CUSTOM:
-      if (nns_edge_custom_release (&eh->custom) !=
+      if (nns_edge_custom_release (eh->custom_connection_h) !=
           NNS_EDGE_ERROR_NONE) {
         nns_edge_logw ("Failed to close custom connection.");
       }
@@ -1614,6 +1612,7 @@ nns_edge_release_handle (nns_edge_h edge_h)
   eh->event_cb = NULL;
   eh->user_data = NULL;
   eh->broker_h = NULL;
+  eh->custom_connection_h = NULL;
 
   nns_edge_queue_destroy (eh->send_queue);
   eh->send_queue = NULL;
@@ -1664,7 +1663,8 @@ nns_edge_set_event_callback (nns_edge_h edge_h, nns_edge_event_cb cb,
   }
 
   if (NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
-    ret = nns_edge_custom_set_event_callback (&eh->custom, cb, user_data);
+    ret = nns_edge_custom_set_event_callback (eh->custom_connection_h,
+        cb, user_data);
     if (NNS_EDGE_ERROR_NONE != ret) {
       goto error;
     }
@@ -1813,7 +1813,7 @@ nns_edge_connect (nns_edge_h edge_h, const char *dest_host, int dest_port)
       }
     }
   } else if (NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
-    ret = nns_edge_custom_connect (&eh->custom);
+    ret = nns_edge_custom_connect (eh->custom_connection_h);
     if (ret != NNS_EDGE_ERROR_NONE) {
       goto done;
     }
@@ -1880,7 +1880,7 @@ nns_edge_is_connected (nns_edge_h edge_h)
     return NNS_EDGE_ERROR_NONE;
 
   if (NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
-    return nns_edge_custom_is_connected (&eh->custom);
+    return nns_edge_custom_is_connected (eh->custom_connection_h);
   }
 
   conn_data = (nns_edge_conn_data_s *) eh->connections;
@@ -2052,7 +2052,7 @@ nns_edge_set_info (nns_edge_h edge_h, const char *key, const char *value)
   if (ret == NNS_EDGE_ERROR_NONE &&
       NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
     /* Pass value to custom library and ignore error. */
-    if (nns_edge_custom_set_info (&eh->custom, key, value) !=
+    if (nns_edge_custom_set_info (eh->custom_connection_h, key, value) !=
         NNS_EDGE_ERROR_NONE) {
       nns_edge_logw ("Failed to set info '%s' in custom connection.", key);
     }
@@ -2128,7 +2128,7 @@ nns_edge_get_info (nns_edge_h edge_h, const char *key, char **value)
       NNS_EDGE_CONNECT_TYPE_CUSTOM == eh->connect_type) {
     char *val = NULL;
 
-    if (nns_edge_custom_get_info (&eh->custom, key, &val) ==
+    if (nns_edge_custom_get_info (eh->custom_connection_h, key, &val) ==
         NNS_EDGE_ERROR_NONE) {
       /* Replace value from custom library. */
       SAFE_FREE (*value);
index 07ffb6c632fc61798f84dc85407cbf8071acb76f..df040181c16addb1139446d2a0772f367b75651d 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <gtest/gtest.h>
+#include "nnstreamer-edge-custom-impl.h"
 #include "nnstreamer-edge-custom.h"
 #include "nnstreamer-edge-data.h"
 #include "nnstreamer-edge-event.h"
@@ -126,6 +127,245 @@ TEST (edgeCustom, expectedReturn)
   EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
 }
 
+/**
+ * @brief Load edge custom - invalid param.
+ */
+TEST (edgeCustom, loadInvalidParam01_n)
+{
+  int ret;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load (NULL, &handle);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Load edge custom - invalid param.
+ */
+TEST (edgeCustom, loadInvalidParam02_n)
+{
+  int ret;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load ("", &handle);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Load edge custom - invalid param.
+ */
+TEST (edgeCustom, loadInvalidParam03_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_load ("libnnstreamer-edge-custom-test.so", NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Release edge custom - invalid param.
+ */
+TEST (edgeCustom, releaseInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_release (NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Start edge custom - invalid param.
+ */
+TEST (edgeCustom, startInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_start (NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Stop edge custom - invalid param.
+ */
+TEST (edgeCustom, stopInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_stop (NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Set event callback of edge custom - invalid param.
+ */
+TEST (edgeCustom, setEventCbInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_set_event_callback (NULL, NULL, NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Connect edge custom - invalid param.
+ */
+TEST (edgeCustom, connectInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_connect (NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Check connection of edge custom - invalid param.
+ */
+TEST (edgeCustom, isConnectedInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_is_connected (NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Send data using edge custom - invalid param.
+ */
+TEST (edgeCustom, sendDataInvalidParam01_n)
+{
+  int ret;
+  nns_edge_data_h data_h;
+
+  ret = nns_edge_data_create (&data_h);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_send_data (NULL, data_h);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_data_destroy (data_h);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Send data using edge custom - invalid param.
+ */
+TEST (edgeCustom, sendDataInvalidParam02_n)
+{
+  int ret;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load ("libnnstreamer-edge-custom-test.so", &handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_send_data (handle, NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_release (handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Set info using edge custom - invalid param.
+ */
+TEST (edgeCustom, setInfoInvalidParam01_n)
+{
+  int ret;
+
+  ret = nns_edge_custom_set_info (NULL, "test-key", "test-value");
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Set info using edge custom - invalid param.
+ */
+TEST (edgeCustom, setInfoInvalidParam02_n)
+{
+  int ret;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load ("libnnstreamer-edge-custom-test.so", &handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_set_info (handle, NULL, "test-value");
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+  ret = nns_edge_custom_set_info (handle, "", "test-value");
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_release (handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Set info using edge custom - invalid param.
+ */
+TEST (edgeCustom, setInfoInvalidParam03_n)
+{
+  int ret;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load ("libnnstreamer-edge-custom-test.so", &handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_set_info (handle, "test-key", NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+  ret = nns_edge_custom_set_info (handle, "test-key", "");
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_release (handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Get info using edge custom - invalid param.
+ */
+TEST (edgeCustom, getInfoInvalidParam01_n)
+{
+  int ret;
+  char *value;
+
+  ret = nns_edge_custom_get_info (NULL, "test-key", &value);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Get info using edge custom - invalid param.
+ */
+TEST (edgeCustom, getInfoInvalidParam02_n)
+{
+  int ret;
+  char *value;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load ("libnnstreamer-edge-custom-test.so", &handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_get_info (handle, NULL, &value);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+  ret = nns_edge_custom_get_info (handle, "", &value);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_release (handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+}
+
+/**
+ * @brief Get info using edge custom - invalid param.
+ */
+TEST (edgeCustom, getInfoInvalidParam03_n)
+{
+  int ret;
+  nns_edge_custom_connection_h handle;
+
+  ret = nns_edge_custom_load ("libnnstreamer-edge-custom-test.so", &handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_get_info (handle, "test-key", NULL);
+  EXPECT_NE (NNS_EDGE_ERROR_NONE, ret);
+
+  ret = nns_edge_custom_release (handle);
+  EXPECT_EQ (NNS_EDGE_ERROR_NONE, ret);
+}
+
 /**
  * @brief Main gtest
  */