Lines Matching refs:test

50 static uint8_t isa_inb(QTestState *qts, const TestCase *test, uint16_t addr)  in isa_inb()  argument
53 if (test->isa_base == -1) { in isa_inb()
56 value = qtest_readb(qts, test->isa_base + addr); in isa_inb()
61 static uint16_t isa_inw(QTestState *qts, const TestCase *test, uint16_t addr) in isa_inw() argument
64 if (test->isa_base == -1) { in isa_inw()
67 value = qtest_readw(qts, test->isa_base + addr); in isa_inw()
69 return test->bswap ? bswap16(value) : value; in isa_inw()
72 static uint32_t isa_inl(QTestState *qts, const TestCase *test, uint16_t addr) in isa_inl() argument
75 if (test->isa_base == -1) { in isa_inl()
78 value = qtest_readl(qts, test->isa_base + addr); in isa_inl()
80 return test->bswap ? bswap32(value) : value; in isa_inl()
83 static void isa_outb(QTestState *qts, const TestCase *test, uint16_t addr, in isa_outb() argument
86 if (test->isa_base == -1) { in isa_outb()
89 qtest_writeb(qts, test->isa_base + addr, value); in isa_outb()
93 static void isa_outw(QTestState *qts, const TestCase *test, uint16_t addr, in isa_outw() argument
96 value = test->bswap ? bswap16(value) : value; in isa_outw()
97 if (test->isa_base == -1) { in isa_outw()
100 qtest_writew(qts, test->isa_base + addr, value); in isa_outw()
104 static void isa_outl(QTestState *qts, const TestCase *test, uint16_t addr, in isa_outl() argument
107 value = test->bswap ? bswap32(value) : value; in isa_outl()
108 if (test->isa_base == -1) { in isa_outl()
111 qtest_writel(qts, test->isa_base + addr, value); in isa_outl()
118 const TestCase *test = data; in test_endianness() local
121 qts = qtest_initf("-M %s%s%s -device pc-testdev", test->machine, in test_endianness()
122 test->superio ? " -device " : "", in test_endianness()
123 test->superio ?: ""); in test_endianness()
124 isa_outl(qts, test, 0xe0, 0x87654321); in test_endianness()
125 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); in test_endianness()
126 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness()
127 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); in test_endianness()
128 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); in test_endianness()
129 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); in test_endianness()
130 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); in test_endianness()
131 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x21); in test_endianness()
133 isa_outw(qts, test, 0xe2, 0x8866); in test_endianness()
134 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664321); in test_endianness()
135 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); in test_endianness()
136 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); in test_endianness()
137 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x88); in test_endianness()
138 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x66); in test_endianness()
139 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); in test_endianness()
140 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x21); in test_endianness()
142 isa_outw(qts, test, 0xe0, 0x4422); in test_endianness()
143 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664422); in test_endianness()
144 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); in test_endianness()
145 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); in test_endianness()
146 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x88); in test_endianness()
147 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x66); in test_endianness()
148 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x44); in test_endianness()
149 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); in test_endianness()
151 isa_outb(qts, test, 0xe3, 0x87); in test_endianness()
152 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87664422); in test_endianness()
153 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8766); in test_endianness()
154 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); in test_endianness()
155 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x66); in test_endianness()
156 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x44); in test_endianness()
157 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); in test_endianness()
159 isa_outb(qts, test, 0xe2, 0x65); in test_endianness()
160 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654422); in test_endianness()
161 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness()
162 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); in test_endianness()
163 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); in test_endianness()
164 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); in test_endianness()
165 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x44); in test_endianness()
166 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); in test_endianness()
168 isa_outb(qts, test, 0xe1, 0x43); in test_endianness()
169 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654322); in test_endianness()
170 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness()
171 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4322); in test_endianness()
172 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); in test_endianness()
173 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); in test_endianness()
174 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); in test_endianness()
175 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); in test_endianness()
177 isa_outb(qts, test, 0xe0, 0x21); in test_endianness()
178 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); in test_endianness()
179 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness()
180 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); in test_endianness()
181 g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); in test_endianness()
182 g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); in test_endianness()
183 g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); in test_endianness()
184 g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x21); in test_endianness()
190 const TestCase *test = data; in test_endianness_split() local
193 qts = qtest_initf("-M %s%s%s -device pc-testdev", test->machine, in test_endianness_split()
194 test->superio ? " -device " : "", in test_endianness_split()
195 test->superio ?: ""); in test_endianness_split()
196 isa_outl(qts, test, 0xe8, 0x87654321); in test_endianness_split()
197 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); in test_endianness_split()
198 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness_split()
199 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); in test_endianness_split()
201 isa_outw(qts, test, 0xea, 0x8866); in test_endianness_split()
202 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664321); in test_endianness_split()
203 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); in test_endianness_split()
204 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); in test_endianness_split()
206 isa_outw(qts, test, 0xe8, 0x4422); in test_endianness_split()
207 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664422); in test_endianness_split()
208 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); in test_endianness_split()
209 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); in test_endianness_split()
211 isa_outb(qts, test, 0xeb, 0x87); in test_endianness_split()
212 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87664422); in test_endianness_split()
213 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8766); in test_endianness_split()
215 isa_outb(qts, test, 0xea, 0x65); in test_endianness_split()
216 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654422); in test_endianness_split()
217 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness_split()
218 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); in test_endianness_split()
220 isa_outb(qts, test, 0xe9, 0x43); in test_endianness_split()
221 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654322); in test_endianness_split()
222 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness_split()
223 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4322); in test_endianness_split()
225 isa_outb(qts, test, 0xe8, 0x21); in test_endianness_split()
226 g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); in test_endianness_split()
227 g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); in test_endianness_split()
228 g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); in test_endianness_split()
234 const TestCase *test = data; in test_endianness_combine() local
237 qts = qtest_initf("-M %s%s%s -device pc-testdev", test->machine, in test_endianness_combine()
238 test->superio ? " -device " : "", in test_endianness_combine()
239 test->superio ?: ""); in test_endianness_combine()
240 isa_outl(qts, test, 0xe0, 0x87654321); in test_endianness_combine()
241 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654321); in test_endianness_combine()
242 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); in test_endianness_combine()
243 g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4321); in test_endianness_combine()
245 isa_outw(qts, test, 0xe2, 0x8866); in test_endianness_combine()
246 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x88664321); in test_endianness_combine()
247 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8866); in test_endianness_combine()
248 g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4321); in test_endianness_combine()
250 isa_outw(qts, test, 0xe0, 0x4422); in test_endianness_combine()
251 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x88664422); in test_endianness_combine()
252 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8866); in test_endianness_combine()
253 g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4422); in test_endianness_combine()
255 isa_outb(qts, test, 0xe3, 0x87); in test_endianness_combine()
256 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87664422); in test_endianness_combine()
257 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8766); in test_endianness_combine()
259 isa_outb(qts, test, 0xe2, 0x65); in test_endianness_combine()
260 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654422); in test_endianness_combine()
261 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); in test_endianness_combine()
262 g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4422); in test_endianness_combine()
264 isa_outb(qts, test, 0xe1, 0x43); in test_endianness_combine()
265 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654322); in test_endianness_combine()
266 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); in test_endianness_combine()
267 g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4322); in test_endianness_combine()
269 isa_outb(qts, test, 0xe0, 0x21); in test_endianness_combine()
270 g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654321); in test_endianness_combine()
271 g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); in test_endianness_combine()
272 g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4321); in test_endianness_combine()