]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
tests: add test script for ALSAHwdep.DeviceCommon interface
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 19 Jun 2022 11:38:51 +0000 (20:38 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Sun, 19 Jun 2022 11:43:34 +0000 (20:43 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
tests/alsahwdep-device-common [new file with mode: 0644]
tests/meson.build

diff --git a/tests/alsahwdep-device-common b/tests/alsahwdep-device-common
new file mode 100644 (file)
index 0000000..44c0a60
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+from sys import exit
+from errno import ENXIO
+
+from helper import test_object
+
+import gi
+gi.require_version('ALSAHwdep', '0.0')
+from gi.repository import ALSAHwdep
+
+target_type = ALSAHwdep.DeviceCommon
+props = ()
+methods = (
+    'open',
+    'get_protocol_version',
+    'get_device_info',
+    'create_source',
+)
+vmethods = (
+    'do_open',
+    'do_get_protocol_version',
+    'do_get_device_info',
+    'do_create_source',
+    'do_handle_disconnection',
+)
+signals = (
+    'handle-disconnection',
+)
+
+if not test_object(target_type, props, methods, vmethods, signals):
+    exit(ENXIO)
index a6db201b8e67716ef2ddd18774a9285c342361df..ef86c0b5bf54303d12d7dc68f214bb4d92792a05 100644 (file)
@@ -55,6 +55,7 @@ tests = {
   'hwdep': [
     'alsahwdep-enums',
     'alsahwdep-device-info',
+    'alsahwdep-device-common',
   ],
   'rawmidi': [
     'alsarawmidi-enums',