| 1 |
#!/usr/bin/env python3 |
| 2 |
|
| 3 |
from sys import exit |
| 4 |
from errno import ENXIO |
| 5 |
|
| 6 |
from helper import test_enums |
| 7 |
|
| 8 |
import gi |
| 9 |
gi.require_version('Hinoko', '1.0') |
| 10 |
from gi.repository import Hinoko |
| 11 |
|
| 12 |
fw_iso_ctx_mode_enumerators = ( |
| 13 |
'IT', |
| 14 |
'IR_SINGLE', |
| 15 |
'IR_MULTIPLE', |
| 16 |
) |
| 17 |
|
| 18 |
fw_scode_enumerators = ( |
| 19 |
'S100', |
| 20 |
'S200', |
| 21 |
'S400', |
| 22 |
'S800', |
| 23 |
'S1600', |
| 24 |
'S3200', |
| 25 |
) |
| 26 |
|
| 27 |
fw_iso_ctx_match_flags = ( |
| 28 |
'TAG0', |
| 29 |
'TAG1', |
| 30 |
'TAG2', |
| 31 |
'TAG3', |
| 32 |
) |
| 33 |
|
| 34 |
fw_iso_resource_error_enumerations = ( |
| 35 |
'FAILED', |
| 36 |
'OPENED', |
| 37 |
'NOT_OPENED', |
| 38 |
'TIMEOUT', |
| 39 |
'EVENT', |
| 40 |
) |
| 41 |
|
| 42 |
fw_iso_resource_auto_error_enumerations = ( |
| 43 |
'FAILED', |
| 44 |
'ALLOCATED', |
| 45 |
'NOT_ALLOCATED', |
| 46 |
) |
| 47 |
|
| 48 |
fw_iso_ctx_error_enumerations = ( |
| 49 |
'FAILED', |
| 50 |
'ALLOCATED', |
| 51 |
'NOT_ALLOCATED', |
| 52 |
'MAPPED', |
| 53 |
'NOT_MAPPED', |
| 54 |
'CHUNK_UNREGISTERED', |
| 55 |
'NO_ISOC_CHANNEL', |
| 56 |
) |
| 57 |
|
| 58 |
types = { |
| 59 |
Hinoko.FwIsoCtxMode: fw_iso_ctx_mode_enumerators, |
| 60 |
Hinoko.FwScode: fw_scode_enumerators, |
| 61 |
Hinoko.FwIsoCtxMatchFlag: fw_iso_ctx_match_flags, |
| 62 |
Hinoko.FwIsoResourceError: fw_iso_resource_error_enumerations, |
| 63 |
Hinoko.FwIsoResourceAutoError: fw_iso_resource_auto_error_enumerations, |
| 64 |
Hinoko.FwIsoCtxError: fw_iso_ctx_error_enumerations, |
| 65 |
} |
| 66 |
|
| 67 |
for target_type, enumerations in types.items(): |
| 68 |
if not test_enums(target_type, enumerations): |
| 69 |
exit(ENXIO) |