[UTC][usb-host][ACR-917] Add negative test cases
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Mon, 27 Mar 2017 12:12:48 +0000 (14:12 +0200)
committerJihun Park <jihun87.park@samsung.com>
Thu, 20 Apr 2017 02:01:51 +0000 (19:01 -0700)
Change-Id: Ia9d68f3b35a6daac50f3e85291ccdc784d315e85
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
src/utc/usb-host/public.list
src/utc/usb-host/tct-usb-host-core_mobile.h
src/utc/usb-host/utc-usb-host.c

index 2bc5ba1d294d02a728a4409deecb7d01817a13a5..094495f720df2080102c5d57cf60556d123b7c17 100644 (file)
@@ -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
index 5e02579b33c60dcfb0a2e7edfed494a3474139ab..90eb07c0640e2e541f34ee3011472cf0a3d3c2a3 100644 (file)
@@ -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}
 };
 
index 59c91647f206cf56ba58cf402f7cf13223451731..4e27ad324e02c6bb56b8b64cca2515b0bf526350 100644 (file)
@@ -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;
+}