From 30a7982f26b8c785f6f2f1ebc87853622fbecd81 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sun, 19 Jun 2022 20:38:51 +0900 Subject: [PATCH] tests: add test script for ALSAHwdep.DeviceCommon interface Signed-off-by: Takashi Sakamoto --- tests/alsahwdep-device-common | 32 ++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 33 insertions(+) create mode 100644 tests/alsahwdep-device-common diff --git a/tests/alsahwdep-device-common b/tests/alsahwdep-device-common new file mode 100644 index 0000000..44c0a60 --- /dev/null +++ b/tests/alsahwdep-device-common @@ -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) diff --git a/tests/meson.build b/tests/meson.build index a6db201..ef86c0b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -55,6 +55,7 @@ tests = { 'hwdep': [ 'alsahwdep-enums', 'alsahwdep-device-info', + 'alsahwdep-device-common', ], 'rawmidi': [ 'alsarawmidi-enums', -- 2.47.3