[calls] tests: Add ui-call tests
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] tests: Add ui-call tests
- Date: Tue, 1 Feb 2022 23:55:09 +0000 (UTC)
commit 1ca83bc2bca8bb80efa57b5b6c106bf41b393483
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Tue Feb 1 19:13:16 2022 +0100
tests: Add ui-call tests
For now we only test the state mapping.
tests/meson.build | 13 +++++++++++++
tests/test-ui-call.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
---
diff --git a/tests/meson.build b/tests/meson.build
index 67f63d3a..3f9255a1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -115,6 +115,19 @@ t = executable('util', test_sources,
)
test('util', t, env: test_env)
+test_sources = [ 'test-ui-call.c' ]
+t = executable('ui-call', test_sources,
+ c_args : test_cflags,
+ link_args : test_link_args,
+ pie: true,
+ link_with : [calls_vala, libcalls],
+ dependencies : calls_deps,
+ include_directories : [
+ calls_includes
+ ]
+ )
+test('ui-call', t, env: test_env)
+
mock_link_args = [ test_link_args,
'-Wl,--wrap=lfb_init',
'-Wl,--wrap=lfb_uninit',
diff --git a/tests/test-ui-call.c b/tests/test-ui-call.c
new file mode 100644
index 00000000..30267ece
--- /dev/null
+++ b/tests/test-ui-call.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 Purism SPC
+ *
+ * SPDX-License-Identifier: GPL-3.0+
+ *
+ * Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
+ *
+ */
+
+#include "calls-ui-call-data.h"
+
+#include <gtk/gtk.h>
+
+static void
+test_cui_call_state_mapping (void)
+{
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_UNKNOWN),
+ ==, CUI_CALL_STATE_UNKNOWN);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_ACTIVE),
+ ==, CUI_CALL_STATE_ACTIVE);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_DIALING),
+ ==, CUI_CALL_STATE_CALLING);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_ALERTING),
+ ==, CUI_CALL_STATE_CALLING);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_INCOMING),
+ ==, CUI_CALL_STATE_INCOMING);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_WAITING),
+ ==, CUI_CALL_STATE_INCOMING);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (CALLS_CALL_STATE_DISCONNECTED),
+ ==, CUI_CALL_STATE_DISCONNECTED);
+ g_assert_cmpint (calls_call_state_to_cui_call_state (42), ==, CUI_CALL_STATE_UNKNOWN);
+}
+
+
+int
+main (int argc,
+ char *argv[])
+{
+ gtk_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/Calls/UI/state_mapping", (GTestFunc) test_cui_call_state_mapping);
+
+ g_test_run ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]