From: Paweł Szewczyk
Date: Mon, 27 Mar 2017 12:12:48 +0000 (+0200)
Subject: [UTC][usb-host][ACR-917] Add negative test cases
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69f71cd36ed3952b92887517f8a0d11a9a3bb78c;p=test%2Ftct%2Fnative%2Fapi.git
[UTC][usb-host][ACR-917] Add negative test cases
Change-Id: Ia9d68f3b35a6daac50f3e85291ccdc784d315e85
Signed-off-by: Paweł Szewczyk
---
diff --git a/src/utc/usb-host/public.list b/src/utc/usb-host/public.list
index 2bc5ba1d2..094495f72 100644
--- a/src/utc/usb-host/public.list
+++ b/src/utc/usb-host/public.list
@@ -49,3 +49,5 @@ usb_host_endpoint_get_max_packet_size
usb_host_endpoint_get_interval
usb_host_control_transfer
usb_host_transfer
+usb_host_set_hotplug_cb
+usb_host_unset_hotplug_cb
diff --git a/src/utc/usb-host/tct-usb-host-core_mobile.h b/src/utc/usb-host/tct-usb-host-core_mobile.h
index 5e02579b3..90eb07c06 100644
--- a/src/utc/usb-host/tct-usb-host-core_mobile.h
+++ b/src/utc/usb-host/tct-usb-host-core_mobile.h
@@ -76,6 +76,8 @@ extern int utc_usb_host_interface_set_altsetting_n(void);
extern int utc_usb_host_device_get_config_n(void);
extern int utc_usb_host_control_transfer_n(void);
extern int utc_usb_host_transfer_n(void);
+extern int utc_usb_host_set_hotplug_cb_n(void);
+extern int utc_usb_host_unset_hotplug_cb_n(void);
testcase tc_array[] = {
{"utc_usb_host_claim_interface_n", utc_usb_host_claim_interface_n, NULL, NULL},
@@ -129,6 +131,8 @@ testcase tc_array[] = {
{"utc_usb_host_set_config_n", utc_usb_host_set_config_n, NULL, NULL},
{"utc_usb_host_transfer_n", utc_usb_host_transfer_n, NULL, NULL},
{"utc_usb_host_unref_device_n", utc_usb_host_unref_device_n, NULL, NULL},
+ {"utc_usb_host_set_hotplug_cb_n", utc_usb_host_set_hotplug_cb_n, NULL, NULL},
+ {"utc_usb_host_unset_hotplug_cb_n", utc_usb_host_unset_hotplug_cb_n, NULL, NULL},
{NULL, NULL}
};
diff --git a/src/utc/usb-host/utc-usb-host.c b/src/utc/usb-host/utc-usb-host.c
index 59c91647f..4e27ad324 100644
--- a/src/utc/usb-host/utc-usb-host.c
+++ b/src/utc/usb-host/utc-usb-host.c
@@ -1000,3 +1000,37 @@ int utc_usb_host_transfer_n(void)
return 0;
}
+
+/**
+ * @testcase utc_usb_host_set_hotplug_cb_n
+ * @since_tizen 4.0
+ * @type negative
+ * @description Set hotplug callback
+ * @scenario Checks if passing NULL parameters results in INVALID_PARAMETER error
+ */
+int utc_usb_host_set_hotplug_cb_n(void)
+{
+ int ret;
+
+ ret = usb_host_set_hotplug_cb(NULL, NULL, USB_HOST_HOTPLUG_EVENT_ANY, NULL, NULL);
+ assert_eq_supp(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_unset_hotplug_cb_n
+ * @since_tizen 4.0
+ * @type negative
+ * @description Unset hotplug callback
+ * @scenario Checks if passing NULL parameters results in INVALID_PARAMETER error
+ */
+int utc_usb_host_unset_hotplug_cb_n(void)
+{
+ int ret;
+
+ ret = usb_host_unset_hotplug_cb(NULL);
+ assert_eq_supp(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}