]> git.proxmox.com Git - mirror_qemu.git/blame - tests/ipoctal232-test.c
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[mirror_qemu.git] / tests / ipoctal232-test.c
CommitLineData
37146829
AF
1/*
2 * QTest testcase for IndustryPack Octal-RS232
3 *
4 * Copyright (c) 2014 SUSE LINUX Products GmbH
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
681c28a3 10#include "qemu/osdep.h"
37146829 11#include "libqtest.h"
31692b2e
EGE
12#include "libqos/qgraph.h"
13
14typedef struct QIpoctal232 QIpoctal232;
15
16struct QIpoctal232 {
17 QOSGraphObject obj;
18};
37146829
AF
19
20/* Tests only initialization so far. TODO: Replace with functional tests */
31692b2e 21static void nop(void *obj, void *data, QGuestAllocator *alloc)
37146829
AF
22{
23}
24
31692b2e
EGE
25static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc,
26 void *addr)
37146829 27{
31692b2e 28 QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1);
37146829 29
31692b2e
EGE
30 return &ipoctal232->obj;
31}
37146829 32
31692b2e
EGE
33static void ipoctal232_register_nodes(void)
34{
35 qos_node_create_driver("ipoctal232", ipoctal232_create);
36 qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) {
37 .extra_device_opts = "bus=ipack0.0",
38 });
39}
37146829 40
31692b2e 41libqos_init(ipoctal232_register_nodes);
37146829 42
31692b2e
EGE
43static void register_ipoctal232_test(void)
44{
45 qos_add_test("nop", "ipoctal232", nop, NULL);
37146829 46}
31692b2e
EGE
47
48libqos_init(register_ipoctal232_test);