File: hinawa-enum

package info (click to toggle)
libhinawa 4.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 540 kB
  • sloc: ansic: 1,901; python: 690; javascript: 5; makefile: 5
file content (89 lines) | stat: -rw-r--r-- 1,733 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env python3

from sys import exit
from errno import ENXIO

from helper import test_enums

import gi
gi.require_version('Hinawa', '4.0')
from gi.repository import Hinawa

fw_tcode_enumerators = (
    'WRITE_QUADLET_REQUEST',
    'WRITE_BLOCK_REQUEST',
    'WRITE_RESPONSE',
    'READ_QUADLET_REQUEST',
    'READ_BLOCK_REQUEST',
    'READ_QUADLET_RESPONSE',
    'READ_BLOCK_RESPONSE',
    'CYCLE_START',
    'LOCK_REQUEST',
    'STREAM_DATA',
    'LOCK_RESPONSE',
    'LOCK_MASK_SWAP',
    'LOCK_COMPARE_SWAP',
    'LOCK_FETCH_ADD',
    'LOCK_LITTLE_ADD',
    'LOCK_BOUNDED_ADD',
    'LOCK_WRAP_ADD',
    'LOCK_VENDOR_DEPENDENT',
)

fw_rcode_enumerators = (
    'COMPLETE',
    'CONFLICT_ERROR',
    'DATA_ERROR',
    'TYPE_ERROR',
    'ADDRESS_ERROR',
    'SEND_ERROR',
    'CANCELLED',
    'BUSY',
    'GENERATION',
    'NO_ACK',
)

fw_req_error_enumerations = (
    'CONFLICT_ERROR',
    'DATA_ERROR',
    'TYPE_ERROR',
    'ADDRESS_ERROR',
    'SEND_ERROR',
    'CANCELLED',
    'BUSY',
    'GENERATION',
    'NO_ACK',
    'INVALID',
)

fw_node_error_enumerators = (
    'DISCONNECTED',
    'OPENED',
    'NOT_OPENED',
    'FAILED',
)

fw_resp_error_enumerations = (
    'FAILED',
    'RESERVED',
    'ADDR_SPACE_USED',
)

fw_fcp_error_enumerators = (
    'TIMEOUT',
    'LARGE_RESP',
    'ABORTED',
)

types = {
    Hinawa.FwTcode: fw_tcode_enumerators,
    Hinawa.FwRcode: fw_rcode_enumerators,
    Hinawa.FwReqError: fw_req_error_enumerations,
    Hinawa.FwNodeError: fw_node_error_enumerators,
    Hinawa.FwRespError: fw_resp_error_enumerations,
    Hinawa.FwFcpError: fw_fcp_error_enumerators,
}

for target_type, enumerations in types.items():
    if not test_enums(target_type, enumerations):
        exit(ENXIO)