Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
from sys import exit
from errno import ENXIO
-from helper import test_object
+from helper import test_struct
import gi
gi.require_version('ALSACtl', '0.0')
from gi.repository import ALSACtl
-target = ALSACtl.ElemId()
-props = ()
+target_type = ALSACtl.ElemId
methods = (
'get_numid',
'get_iface',
- 'get_device',
- 'get_subdevice',
+ 'get_device_id',
+ 'get_subdevice_id',
'get_name',
'get_index',
- 'equals',
+ 'equal',
)
-signals = ()
-if not test_object(target, props, methods, signals):
+if not test_struct(target_type, methods):
exit(ENXIO)
enumeration, target_type))
return False
return True
+
+
+def test_struct(target_type: object, methods: tuple[str]) -> bool:
+ for method in methods:
+ if not hasattr(target_type, method):
+ print('Method {0} is not produced.'.format(method))
+ return False
+ return True
'alsactl-elem-info-integer64',
'alsactl-elem-info-enumerated',
'alsactl-elem-value',
+ 'alsactl-elem-id',
],
'timer': [
'alsatimer-enums',