tests: Add pvpanic qtest
[qemu/ar7.git] / tests / pvpanic-test.c
blob7bb4d06f7da857cff7cc79c81bd506e206b4fd44
1 /*
2 * QTest testcase for PV Panic
4 * Copyright (c) 2014 SUSE LINUX Products GmbH
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 */
10 #include <glib.h>
11 #include <string.h>
12 #include "libqtest.h"
13 #include "qemu/osdep.h"
15 static void test_panic(void)
17 uint8_t val;
19 val = inb(0x505);
20 g_assert_cmpuint(val, ==, 1);
22 outb(0x505, 0x1);
25 int main(int argc, char **argv)
27 int ret;
29 g_test_init(&argc, &argv, NULL);
30 qtest_add_func("/pvpanic/panic", test_panic);
32 qtest_start("-device pvpanic");
33 ret = g_test_run();
35 qtest_end();
37 return ret;