xref: /openbmc/qemu/tests/unit/io-channel-helpers.h (revision 757acb9a8295e8be4a37b2cfc1cd947e357fd29c)
1*da668aa1SThomas Huth /*
2*da668aa1SThomas Huth  * QEMU I/O channel test helpers
3*da668aa1SThomas Huth  *
4*da668aa1SThomas Huth  * Copyright (c) 2015 Red Hat, Inc.
5*da668aa1SThomas Huth  *
6*da668aa1SThomas Huth  * This library is free software; you can redistribute it and/or
7*da668aa1SThomas Huth  * modify it under the terms of the GNU Lesser General Public
8*da668aa1SThomas Huth  * License as published by the Free Software Foundation; either
9*da668aa1SThomas Huth  * version 2.1 of the License, or (at your option) any later version.
10*da668aa1SThomas Huth  *
11*da668aa1SThomas Huth  * This library is distributed in the hope that it will be useful,
12*da668aa1SThomas Huth  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*da668aa1SThomas Huth  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14*da668aa1SThomas Huth  * Lesser General Public License for more details.
15*da668aa1SThomas Huth  *
16*da668aa1SThomas Huth  * You should have received a copy of the GNU Lesser General Public
17*da668aa1SThomas Huth  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18*da668aa1SThomas Huth  */
19*da668aa1SThomas Huth 
20*da668aa1SThomas Huth #ifndef TEST_IO_CHANNEL_HELPERS_H
21*da668aa1SThomas Huth #define TEST_IO_CHANNEL_HELPERS_H
22*da668aa1SThomas Huth 
23*da668aa1SThomas Huth #include "io/channel.h"
24*da668aa1SThomas Huth 
25*da668aa1SThomas Huth typedef struct QIOChannelTest QIOChannelTest;
26*da668aa1SThomas Huth 
27*da668aa1SThomas Huth QIOChannelTest *qio_channel_test_new(void);
28*da668aa1SThomas Huth 
29*da668aa1SThomas Huth void qio_channel_test_run_threads(QIOChannelTest *test,
30*da668aa1SThomas Huth                                   bool blocking,
31*da668aa1SThomas Huth                                   QIOChannel *src,
32*da668aa1SThomas Huth                                   QIOChannel *dst);
33*da668aa1SThomas Huth 
34*da668aa1SThomas Huth void qio_channel_test_run_writer(QIOChannelTest *test,
35*da668aa1SThomas Huth                                  QIOChannel *src);
36*da668aa1SThomas Huth void qio_channel_test_run_reader(QIOChannelTest *test,
37*da668aa1SThomas Huth                                  QIOChannel *dst);
38*da668aa1SThomas Huth 
39*da668aa1SThomas Huth void qio_channel_test_validate(QIOChannelTest *test);
40*da668aa1SThomas Huth 
41*da668aa1SThomas Huth #endif /* TEST_IO_CHANNEL_HELPERS_H */
42