--- /dev/null
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef __TCT_USB_HOST_NATIVE_H__
+#define __TCT_USB_HOST_NATIVE_H__
+
+#include "testcase.h"
+
+extern void utc_usb_host_context_startup(void);
+extern void utc_usb_host_context_cleanup(void);
+extern void utc_usb_host_device_startup(void);
+extern void utc_usb_host_device_cleanup(void);
+extern void utc_usb_host_config_startup(void);
+extern void utc_usb_host_config_cleanup(void);
+
+extern int utc_usb_host_create_n(void);
+extern int utc_usb_host_get_device_list_n(void);
+extern int utc_usb_host_free_device_list_n(void);
+extern int utc_usb_host_device_open_n(void);
+extern int utc_usb_host_device_close_n(void);
+extern int utc_usb_host_device_open_with_vid_pid_n(void);
+extern int utc_usb_host_ref_device_n(void);
+extern int utc_usb_host_unref_device_n(void);
+extern int utc_usb_host_device_get_bus_number_n(void);
+extern int utc_usb_host_device_get_address_n(void);
+extern int utc_usb_host_get_active_config_n(void);
+extern int utc_usb_host_device_get_bcd_usb_n(void);
+extern int utc_usb_host_device_get_class_n(void);
+extern int utc_usb_host_device_get_sub_class_n(void);
+extern int utc_usb_host_device_get_protocol_n(void);
+extern int utc_usb_host_device_get_max_packet_size_0_n(void);
+extern int utc_usb_host_device_get_id_vendor_n(void);
+extern int utc_usb_host_device_get_id_product_n(void);
+extern int utc_usb_host_device_get_bcd_device_n(void);
+extern int utc_usb_host_device_get_num_configurations_n(void);
+extern int utc_usb_host_is_device_opened_n(void);
+extern int utc_usb_host_device_get_manufacturer_str_n(void);
+extern int utc_usb_host_device_get_product_str_n(void);
+extern int utc_usb_host_device_get_serial_number_str_n(void);
+extern int utc_usb_host_config_destroy_n(void);
+extern int utc_usb_host_config_get_num_interfaces_n(void);
+extern int utc_usb_host_config_is_self_powered_n(void);
+extern int utc_usb_host_config_support_remote_wakeup_n(void);
+extern int utc_usb_host_config_get_max_power_n(void);
+extern int utc_usb_host_config_get_interface_n(void);
+extern int utc_usb_host_claim_interface_n(void);
+extern int utc_usb_host_release_interface_n(void);
+extern int utc_usb_host_interface_get_number_n(void);
+extern int utc_usb_host_interface_get_num_endpoints_n(void);
+extern int utc_usb_host_interface_get_endpoint_n(void);
+extern int utc_usb_host_interface_get_str_n(void);
+extern int utc_usb_host_endpoint_get_number_n(void);
+extern int utc_usb_host_endpoint_get_direction_n(void);
+extern int utc_usb_host_endpoint_get_transfer_type_n(void);
+extern int utc_usb_host_endpoint_get_synch_type_n(void);
+extern int utc_usb_host_endpoint_get_usage_type_n(void);
+extern int utc_usb_host_endpoint_get_max_packet_size_n(void);
+extern int utc_usb_host_endpoint_get_interval_n(void);
+extern int utc_usb_host_destroy_n(void);
+extern int utc_usb_host_device_get_port_numbers_n(void);
+extern int utc_usb_host_set_config_n(void);
+extern int utc_usb_host_device_get_config_str_n(void);
+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);
+
+testcase tc_array[] = {
+ {"utc_usb_host_claim_interface_n", utc_usb_host_claim_interface_n, NULL, NULL},
+ {"utc_usb_host_config_destroy_n", utc_usb_host_config_destroy_n, NULL, NULL},
+ {"utc_usb_host_config_get_interface_n", utc_usb_host_config_get_interface_n, NULL, NULL},
+ {"utc_usb_host_config_get_max_power_n", utc_usb_host_config_get_max_power_n, NULL, NULL},
+ {"utc_usb_host_config_get_num_interfaces_n", utc_usb_host_config_get_num_interfaces_n, NULL, NULL},
+ {"utc_usb_host_config_is_self_powered_n", utc_usb_host_config_is_self_powered_n, NULL, NULL},
+ {"utc_usb_host_config_support_remote_wakeup_n", utc_usb_host_config_support_remote_wakeup_n, NULL, NULL},
+ {"utc_usb_host_control_transfer_n", utc_usb_host_control_transfer_n, NULL, NULL},
+ {"utc_usb_host_create_n", utc_usb_host_create_n, NULL, NULL},
+ {"utc_usb_host_destroy_n", utc_usb_host_destroy_n, NULL, NULL},
+ {"utc_usb_host_device_close_n", utc_usb_host_device_close_n, NULL, NULL},
+ {"utc_usb_host_device_get_address_n", utc_usb_host_device_get_address_n, NULL, NULL},
+ {"utc_usb_host_device_get_bcd_device_n", utc_usb_host_device_get_bcd_device_n, NULL, NULL},
+ {"utc_usb_host_device_get_bcd_usb_n", utc_usb_host_device_get_bcd_usb_n, NULL, NULL},
+ {"utc_usb_host_device_get_bus_number_n", utc_usb_host_device_get_bus_number_n, NULL, NULL},
+ {"utc_usb_host_device_get_class_n", utc_usb_host_device_get_class_n, NULL, NULL},
+ {"utc_usb_host_device_get_config_n", utc_usb_host_device_get_config_n, NULL, NULL},
+ {"utc_usb_host_device_get_config_str_n", utc_usb_host_device_get_config_str_n, NULL, NULL},
+ {"utc_usb_host_device_get_id_product_n", utc_usb_host_device_get_id_product_n, NULL, NULL},
+ {"utc_usb_host_device_get_id_vendor_n", utc_usb_host_device_get_id_vendor_n, NULL, NULL},
+ {"utc_usb_host_device_get_manufacturer_str_n", utc_usb_host_device_get_manufacturer_str_n, NULL, NULL},
+ {"utc_usb_host_device_get_max_packet_size_0_n", utc_usb_host_device_get_max_packet_size_0_n, NULL, NULL},
+ {"utc_usb_host_device_get_num_configurations_n", utc_usb_host_device_get_num_configurations_n, NULL, NULL},
+ {"utc_usb_host_device_get_port_numbers_n", utc_usb_host_device_get_port_numbers_n, NULL, NULL},
+ {"utc_usb_host_device_get_product_str_n", utc_usb_host_device_get_product_str_n, NULL, NULL},
+ {"utc_usb_host_device_get_protocol_n", utc_usb_host_device_get_protocol_n, NULL, NULL},
+ {"utc_usb_host_device_get_serial_number_str_n", utc_usb_host_device_get_serial_number_str_n, NULL, NULL},
+ {"utc_usb_host_device_get_sub_class_n", utc_usb_host_device_get_sub_class_n, NULL, NULL},
+ {"utc_usb_host_device_open_n", utc_usb_host_device_open_n, NULL, NULL},
+ {"utc_usb_host_device_open_with_vid_pid_n", utc_usb_host_device_open_with_vid_pid_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_direction_n", utc_usb_host_endpoint_get_direction_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_interval_n", utc_usb_host_endpoint_get_interval_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_max_packet_size_n", utc_usb_host_endpoint_get_max_packet_size_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_number_n", utc_usb_host_endpoint_get_number_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_synch_type_n", utc_usb_host_endpoint_get_synch_type_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_transfer_type_n", utc_usb_host_endpoint_get_transfer_type_n, NULL, NULL},
+ {"utc_usb_host_endpoint_get_usage_type_n", utc_usb_host_endpoint_get_usage_type_n, NULL, NULL},
+ {"utc_usb_host_free_device_list_n", utc_usb_host_free_device_list_n, NULL, NULL},
+ {"utc_usb_host_get_active_config_n", utc_usb_host_get_active_config_n, NULL, NULL},
+ {"utc_usb_host_get_device_list_n", utc_usb_host_get_device_list_n, NULL, NULL},
+ {"utc_usb_host_interface_get_endpoint_n", utc_usb_host_interface_get_endpoint_n, NULL, NULL},
+ {"utc_usb_host_interface_get_number_n", utc_usb_host_interface_get_number_n, NULL, NULL},
+ {"utc_usb_host_interface_get_num_endpoints_n", utc_usb_host_interface_get_num_endpoints_n, NULL, NULL},
+ {"utc_usb_host_interface_get_str_n", utc_usb_host_interface_get_str_n, NULL, NULL},
+ {"utc_usb_host_interface_set_altsetting_n", utc_usb_host_interface_set_altsetting_n, NULL, NULL},
+ {"utc_usb_host_is_device_opened_n", utc_usb_host_is_device_opened_n, NULL, NULL},
+ {"utc_usb_host_ref_device_n", utc_usb_host_ref_device_n, NULL, NULL},
+ {"utc_usb_host_release_interface_n", utc_usb_host_release_interface_n, NULL, NULL},
+ {"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},
+ {NULL, NULL}
+};
+
+#endif // __TCT_USB_HOST_NATIVE_H__
--- /dev/null
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "assert.h"
+
+#include <usb_host.h>
+#include <string.h>
+#include <stdbool.h>
+#include <system_info.h>
+
+//& set: UsbHost
+
+#define assert_streq(var, ref) \
+ do { \\
+ if (strcmp(var, ref)) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == %s) is not equal to (%s == %s)\\n", \
+ __FILE__, __LINE__, #var, var, #ref, ref); \
+ return 1; \
+ } \
+ } while (0);
+
+
+/**
+ * @testcase utc_usb_host_create_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Initialize context of usb-host
+ * @scenario Calling usb_host_create with NULL parameter should end with error.
+ */
+int utc_usb_host_create_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_create(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_get_device_list_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get list of all connected devices
+ * @scenario Calling usb_host_get_device_list with NULL should result
+ * in INVALID_PARAMETER error.
+ */
+int utc_usb_host_get_device_list_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_get_device_list(NULL, NULL, NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_free_device_list_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Free list of devices
+ * @scenario Calling usb_host_free_device_list with NULL should result
+ * in INVALID_PARAMETER error.
+ */
+int utc_usb_host_free_device_list_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_free_device_list(NULL, 0);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_device_open_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Open a device
+ * @scenario Opening NULL device should end with ERROR_INVALID
+ */
+int utc_usb_host_device_open_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_open(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_close_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Close a device
+ * @scenario Closing NULL shoud end with ERROR_INVALID_PARAMETER
+ */
+int utc_usb_host_device_close_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_close(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_open_with_vid_pid_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Open a device with give vid and pid
+ * @scenario Opening device with NULL parameter should result in error
+ */
+int utc_usb_host_device_open_with_vid_pid_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_open_with_vid_pid(NULL, 0, 0, NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_ref_device_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Increase device refcount
+ * @scenario Check if passing NULL as parameter ends with INVALID_PARAMETER error
+ */
+int utc_usb_host_ref_device_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_ref_device(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+
+/**
+ * @testcase utc_usb_host_unref_device_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Decrease device refcount
+ * @scenario Check if passing NULL as parameter ends with INVALID_PARAMETER error
+ */
+int utc_usb_host_unref_device_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_unref_device(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_bus_number_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get device bus number
+ * @scenario Function should end with error when NULL is passed as parameter
+ */
+int utc_usb_host_device_get_bus_number_n(void)
+{
+ int ret;
+ int bus_number;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_bus_number(NULL, &bus_number);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_address_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get device address
+ * @scenario Function should end with error when NULL is passed as parameter
+ */
+int utc_usb_host_device_get_address_n(void)
+{
+ int ret;
+ int addr;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_address(NULL, &addr);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_active_config_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get configuration
+ * @scenario Function should return error when NULL parameter is passed
+ */
+int utc_usb_host_get_active_config_n(void)
+{
+ usb_host_config_h config;
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_get_active_config(NULL, &config);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_config_destroy_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Destroy configuration
+ * @scenario Passing NULL configuration should end with ERROR_INVALID_PARAMETER
+ */
+int utc_usb_host_config_destroy_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_config_destroy(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_bcd_usb_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get bcdUSB field from device
+ * @scenario Function should end with error when NULL parameter is passed
+ */
+int utc_usb_host_device_get_bcd_usb_n(void)
+{
+ int bcd_usb;
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_bcd_usb(NULL, &bcd_usb);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_class_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get bDeviceClass value from device
+ * @scenario Checks if passing NULL as parameter result in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_class_n(void)
+{
+ int ret;
+ int device_class;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_class(NULL, &device_class);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_sub_class_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get bDeviceSubClass value from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_sub_class_n(void)
+{
+ int ret;
+ int sub_class;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_sub_class(NULL, &sub_class);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_protocol_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get bDeviceProtocol value from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_protocol_n(void)
+{
+ int ret;
+ int protocol;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_class(NULL, &protocol);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_max_packet_size_0_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get bDeviceMaxPacketSize0 value from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_max_packet_size_0_n(void)
+{
+ int ret;
+ int size;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_max_packet_size_0(NULL, &size);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_id_vendor_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get idVendor value from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_id_vendor_n(void)
+{
+ int ret;
+ int vid;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_id_vendor(NULL, &vid);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_id_product_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get idProduct value from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_id_product_n(void)
+{
+ int ret;
+ int pid;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_id_product(NULL, &pid);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_bcd_device_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get bcdDevice value from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_bcd_device_n(void)
+{
+ int ret;
+ int bcd;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_bcd_device(NULL, &bcd);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_num_configurations_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get number of configurations from device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_num_configurations_n(void)
+{
+ int ret;
+ int num;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_num_configurations(NULL, &num);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_is_device_opened_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Check if device is opened
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_is_device_opened_n(void)
+{
+ int ret;
+ bool opened;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_is_device_opened(NULL, &opened);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_get_manufacturer_str_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get manufacturer string
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_manufacturer_str_n(void)
+{
+ int ret;
+ unsigned char buffer[256];
+ int len = 256;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_manufacturer_str(NULL, &len, buffer);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_get_product_str_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get product string
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_product_str_n(void)
+{
+ int ret;
+ unsigned char buffer[256];
+ int len = 256;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_product_str(NULL, &len, buffer);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_get_product_str_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get product string
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_serial_number_str_n(void)
+{
+ int ret;
+ unsigned char buffer[256];
+ int len = 256;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_serial_number_str(NULL, &len, buffer);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_get_num_interfaces_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get number of interfaces
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_config_get_num_interfaces_n(void)
+{
+ int ret;
+ int num;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_config_get_num_interfaces(NULL, &num);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_is_self_powered_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Check if device is self-powered
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_config_is_self_powered_n(void)
+{
+ int ret;
+ bool self_powered;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_config_is_self_powered(NULL, &self_powered);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_config_support_remote_wakeup_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Check if device supports remote wakeup
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_config_support_remote_wakeup_n(void)
+{
+ int ret;
+ bool support;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_config_support_remote_wakeup(NULL, &support);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_config_get_max_power_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get max power in given configuration
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_config_get_max_power_n(void)
+{
+ int ret;
+ int max_power;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_config_get_max_power(NULL, &max_power);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_config_get_str_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get config string
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_config_str_n(void)
+{
+ int ret;
+ unsigned char buffer[256];
+ int len = 256;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_config_str(NULL, &len, buffer);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_config_get_interface_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an interface
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_config_get_interface_n(void)
+{
+ int ret;
+ usb_host_interface_h iface;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_config_get_interface(NULL, 0, &iface);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_claim_interface_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Claim an interface
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_claim_interface_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_claim_interface(NULL, 0);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_release_interface_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Release an interface
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_release_interface_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_release_interface(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_interface_get_number_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an interface number
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_interface_get_number_n(void)
+{
+ int ret;
+ int number;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_interface_get_number(NULL, &number);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_interface_get_num_endpoints_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get number of endpoints in interface
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_interface_get_num_endpoints_n(void)
+{
+ int ret;
+ int num;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_interface_get_num_endpoints(NULL, &num);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_interface_get_endpoint_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint from interface
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_interface_get_endpoint_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_interface_get_endpoint(NULL, 1, NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_interface_get_str_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an interface string
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_interface_get_str_n(void)
+{
+ int ret;
+ unsigned char buffer[256];
+ int len = 256;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_interface_get_str(NULL, &len, buffer);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_endpoint_get_number_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint number
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_number_n(void)
+{
+ int ret;
+ int num;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_number(NULL, &num);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_endpoint_get_direction_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint direction
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_direction_n(void)
+{
+ int ret;
+ int dir;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_direction(NULL, &dir);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_endpoint_get_transfer_type_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint transfer type
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_transfer_type_n(void)
+{
+ int ret;
+ int type;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_transfer_type(NULL, &type);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_endpoint_get_synch_type_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint synchronization type
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_synch_type_n(void)
+{
+ int ret;
+ int type;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_synch_type(NULL, &type);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_endpoint_get_usage_type_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint usage type
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_usage_type_n(void)
+{
+ int ret;
+ int type;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_usage_type(NULL, &type);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_endpoint_get_max_packet_size_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint max packet size
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_max_packet_size_n(void)
+{
+ int ret;
+ int size;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_max_packet_size(NULL, &size);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_endpoint_get_interval_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get an endpoint interval
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_endpoint_get_interval_n(void)
+{
+ int ret;
+ int interval;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_endpoint_get_interval(NULL, &interval);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_usb_host_destroy_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Destroy given host
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_destroy_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_destroy(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_port_numbers_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get device port numbers
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_port_numbers_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_port_numbers(NULL, NULL, 1, NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_set_config_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Set given config
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_set_config_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_set_config(NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_interface_set_altsetting_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Set alternative settings
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_interface_set_altsetting_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_interface_set_altsetting(NULL, 1);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_device_get_config_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Get config of given device
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_device_get_config_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_device_get_config(NULL, 1, NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_control_transfer_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Perform control transfer
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_control_transfer_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_control_transfer(NULL, 0, 0, 0, 0, NULL, 0, 0, NULL);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+
+/**
+ * @testcase utc_usb_host_transfer_n
+ * @since_tizen 3.0
+ * @type negative
+ * @description Perform transfer
+ * @scenario Checks if passing NULL as parameter results in INVALID_PARAMETER error
+ */
+int utc_usb_host_transfer_n(void)
+{
+ int ret;
+ bool is_support;
+
+ ret = system_info_get_platform_bool("http://tizen.org/feature/usb.host", &is_support);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ is_support = false;
+
+ ret = usb_host_transfer(NULL, NULL, 0, NULL, 0);
+ if (is_support)
+ assert_eq(ret, USB_HOST_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, USB_HOST_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}