summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-12-02 14:00:48 +0100
committerBastien Nocera <hadess@hadess.net>2021-12-02 14:00:48 +0100
commit6a413b74e4c3e36221cd68d2f548d2128fed89d1 (patch)
tree0c73bd34010b5d4d6159048b5270f81731c91c4f /tests
parent30f92603e4229a7e3fa0c029ffceb3dbfd9f4bd4 (diff)
downloadgnome-bluetooth-6a413b74e4c3e36221cd68d2f548d2128fed89d1.tar.gz
tests: Add first test for bluetooth-utils
Diffstat (limited to 'tests')
-rw-r--r--tests/meson.build12
-rw-r--r--tests/test-bluetooth-utils.c15
2 files changed, 27 insertions, 0 deletions
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 ();
+}