[gnome-bluetooth/wip/hadess/bluetooth-le-audio: 2/3] tests: Add first test for bluetooth-utils
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/bluetooth-le-audio: 2/3] tests: Add first test for bluetooth-utils
- Date: Thu, 2 Dec 2021 13:01:55 +0000 (UTC)
commit 6a413b74e4c3e36221cd68d2f548d2128fed89d1
Author: Bastien Nocera <hadess hadess net>
Date: Thu Dec 2 14:00:48 2021 +0100
tests: Add first test for bluetooth-utils
tests/meson.build | 12 ++++++++++++
tests/test-bluetooth-utils.c | 15 +++++++++++++++
2 files changed, 27 insertions(+)
---
diff --git a/tests/meson.build b/tests/meson.build
index 817c9de0..eccb2539 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -26,3 +26,15 @@ test_bluetooth_device = executable('test-bluetooth-device',
test('test-bluetooth-device-test',
test_bluetooth_device,
)
+
+test_bluetooth_utils = executable('test-bluetooth-utils',
+ 'test-bluetooth-utils.c',
+ include_directories: [ top_inc, lib_inc],
+ dependencies: deps + private_deps,
+ c_args: cflags,
+ link_with: libgnome_bluetooth,
+)
+
+test('test-bluetooth-device-utils',
+ test_bluetooth_utils,
+)
diff --git a/tests/test-bluetooth-utils.c b/tests/test-bluetooth-utils.c
new file mode 100644
index 00000000..dc786ca2
--- /dev/null
+++ b/tests/test-bluetooth-utils.c
@@ -0,0 +1,15 @@
+#include <bluetooth-utils.c>
+
+static void
+test_appearance (void)
+{
+ g_assert_cmpint (bluetooth_appearance_to_type(0x03c2), ==, BLUETOOTH_TYPE_MOUSE);
+}
+
+int main (int argc, char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_test_add_func ("/bluetooth/appearance", test_appearance);
+
+ return g_test_run ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]