blob: 53a8c9b13ce582764e56a4fa85edafe4fc32d760 [file] [log] [blame]
Andreas Färber37146822014-02-09 12:24:15 +01001/*
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
Andreas Färber37146822014-02-09 12:24:15 +010010#include "qemu/osdep.h"
Marc-André Lureau907b5102022-03-30 13:39:05 +040011#include "libqtest.h"
Markus Armbruster0b8fa322019-05-23 16:35:07 +020012#include "qemu/module.h"
Emanuele Giuseppe Esposito31692b22018-08-17 12:48:27 +020013#include "libqos/qgraph.h"
14
15typedef struct QIpoctal232 QIpoctal232;
16
17struct QIpoctal232 {
18 QOSGraphObject obj;
19};
Andreas Färber37146822014-02-09 12:24:15 +010020
21/* Tests only initialization so far. TODO: Replace with functional tests */
Emanuele Giuseppe Esposito31692b22018-08-17 12:48:27 +020022static void nop(void *obj, void *data, QGuestAllocator *alloc)
Andreas Färber37146822014-02-09 12:24:15 +010023{
24}
25
Emanuele Giuseppe Esposito31692b22018-08-17 12:48:27 +020026static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc,
27 void *addr)
Andreas Färber37146822014-02-09 12:24:15 +010028{
Emanuele Giuseppe Esposito31692b22018-08-17 12:48:27 +020029 QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1);
Andreas Färber37146822014-02-09 12:24:15 +010030
Emanuele Giuseppe Esposito31692b22018-08-17 12:48:27 +020031 return &ipoctal232->obj;
Andreas Färber37146822014-02-09 12:24:15 +010032}
Emanuele Giuseppe Esposito31692b22018-08-17 12:48:27 +020033
34static void ipoctal232_register_nodes(void)
35{
36 qos_node_create_driver("ipoctal232", ipoctal232_create);
37 qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) {
38 .extra_device_opts = "bus=ipack0.0",
39 });
40}
41
42libqos_init(ipoctal232_register_nodes);
43
44static void register_ipoctal232_test(void)
45{
46 qos_add_test("nop", "ipoctal232", nop, NULL);
47}
48
49libqos_init(register_ipoctal232_test);