Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 1 | /* |
| 2 | * QTest testcase for USB OHCI controller |
| 3 | * |
Gonglei | fe75270 | 2015-03-26 20:57:43 +0800 | [diff] [blame] | 4 | * Copyright (c) 2014 HUAWEI TECHNOLOGIES CO., LTD. |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 5 | * |
| 6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 7 | * See the COPYING file in the top-level directory. |
| 8 | */ |
| 9 | |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 10 | #include "qemu/osdep.h" |
Peter Maydell | e532b2e | 2016-01-26 18:17:12 +0000 | [diff] [blame] | 11 | #include "libqtest.h" |
Igor Mammedov | b393768 | 2014-09-26 09:28:14 +0000 | [diff] [blame] | 12 | #include "libqos/usb.h" |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 13 | |
| 14 | |
| 15 | static void test_ohci_init(void) |
| 16 | { |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 17 | |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 18 | } |
| 19 | |
Igor Mammedov | b393768 | 2014-09-26 09:28:14 +0000 | [diff] [blame] | 20 | static void test_ohci_hotplug(void) |
| 21 | { |
| 22 | usb_test_hotplug("ohci", 1, NULL); |
| 23 | } |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 24 | |
| 25 | int main(int argc, char **argv) |
| 26 | { |
| 27 | int ret; |
| 28 | |
| 29 | g_test_init(&argc, &argv, NULL); |
| 30 | |
| 31 | qtest_add_func("/ohci/pci/init", test_ohci_init); |
Igor Mammedov | b393768 | 2014-09-26 09:28:14 +0000 | [diff] [blame] | 32 | qtest_add_func("/ohci/pci/hotplug", test_ohci_hotplug); |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 33 | |
Igor Mammedov | b393768 | 2014-09-26 09:28:14 +0000 | [diff] [blame] | 34 | qtest_start("-device pci-ohci,id=ohci"); |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 35 | ret = g_test_run(); |
Igor Mammedov | b393768 | 2014-09-26 09:28:14 +0000 | [diff] [blame] | 36 | qtest_end(); |
Gonglei | 28edfce | 2014-06-23 19:53:51 +0800 | [diff] [blame] | 37 | |
| 38 | return ret; |
| 39 | } |