Revision b3ce604e tests/fdc-test.c
b/tests/fdc-test.c | ||
---|---|---|
142 | 142 |
} |
143 | 143 |
|
144 | 144 |
st0 = floppy_recv(); |
145 |
if (st0 != 0x40) {
|
|
145 |
if (st0 != 0x60) {
|
|
146 | 146 |
ret = 1; |
147 | 147 |
} |
148 | 148 |
|
... | ... | |
259 | 259 |
assert_bit_set(dir, DSKCHG); |
260 | 260 |
} |
261 | 261 |
|
262 |
static void test_sense_interrupt(void) |
|
263 |
{ |
|
264 |
int drive = 0; |
|
265 |
int head = 0; |
|
266 |
int cyl = 0; |
|
267 |
int ret = 0; |
|
268 |
|
|
269 |
floppy_send(CMD_SENSE_INT); |
|
270 |
ret = floppy_recv(); |
|
271 |
g_assert(ret == 0x80); |
|
272 |
|
|
273 |
floppy_send(CMD_SEEK); |
|
274 |
floppy_send(head << 2 | drive); |
|
275 |
g_assert(!get_irq(FLOPPY_IRQ)); |
|
276 |
floppy_send(cyl); |
|
277 |
|
|
278 |
floppy_send(CMD_SENSE_INT); |
|
279 |
ret = floppy_recv(); |
|
280 |
g_assert(ret == 0x20); |
|
281 |
floppy_recv(); |
|
282 |
} |
|
283 |
|
|
262 | 284 |
/* success if no crash or abort */ |
263 | 285 |
static void fuzz_registers(void) |
264 | 286 |
{ |
... | ... | |
306 | 328 |
qtest_add_func("/fdc/no_media_on_start", test_no_media_on_start); |
307 | 329 |
qtest_add_func("/fdc/read_without_media", test_read_without_media); |
308 | 330 |
qtest_add_func("/fdc/media_change", test_media_change); |
331 |
qtest_add_func("/fdc/sense_interrupt", test_sense_interrupt); |
|
309 | 332 |
qtest_add_func("/fdc/fuzz-registers", fuzz_registers); |
310 | 333 |
|
311 | 334 |
ret = g_test_run(); |
Also available in: Unified diff