2014-06-23 19:53:53 +08:00
|
|
|
/*
|
|
|
|
* QTest testcase for USB xHCI controller
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014 HUAWEI TECHNOLOGIES CO.,LTD.
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "libqtest.h"
|
|
|
|
#include "qemu/osdep.h"
|
2014-09-26 17:28:14 +08:00
|
|
|
#include "libqos/usb.h"
|
2014-06-23 19:53:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void test_xhci_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-09-26 17:28:14 +08:00
|
|
|
static void test_xhci_hotplug(void)
|
|
|
|
{
|
|
|
|
usb_test_hotplug("xhci", 1, NULL);
|
|
|
|
}
|
2014-06-23 19:53:53 +08:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
g_test_init(&argc, &argv, NULL);
|
|
|
|
|
|
|
|
qtest_add_func("/xhci/pci/init", test_xhci_init);
|
2014-09-26 17:28:14 +08:00
|
|
|
qtest_add_func("/xhci/pci/hotplug", test_xhci_hotplug);
|
2014-06-23 19:53:53 +08:00
|
|
|
|
2014-09-26 17:28:14 +08:00
|
|
|
qtest_start("-device nec-usb-xhci,id=xhci");
|
2014-06-23 19:53:53 +08:00
|
|
|
ret = g_test_run();
|
2014-09-26 17:28:14 +08:00
|
|
|
qtest_end();
|
2014-06-23 19:53:53 +08:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|