[calls] tests: util: Test STR_IS_NULL_OR_EMPTY macro
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] tests: util: Test STR_IS_NULL_OR_EMPTY macro
- Date: Tue, 22 Feb 2022 09:30:40 +0000 (UTC)
commit bac8b81a43d7a991cc99162299f8a2d70c42711a
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Fri Feb 18 09:24:19 2022 +0100
tests: util: Test STR_IS_NULL_OR_EMPTY macro
tests/test-util.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/tests/test-util.c b/tests/test-util.c
index 60b2d09e..1e52c8d4 100644
--- a/tests/test-util.c
+++ b/tests/test-util.c
@@ -61,6 +61,15 @@ test_call_icon_names (void)
g_assert_cmpstr (get_call_icon_symbolic_name (TRUE, TRUE), ==, "call-arrow-incoming-missed-symbolic");
}
+
+static void
+test_null_empty_strings (void)
+{
+ g_assert_true (STR_IS_NULL_OR_EMPTY ((const char *) NULL));
+ g_assert_true (STR_IS_NULL_OR_EMPTY (""));
+ g_assert_false (STR_IS_NULL_OR_EMPTY ("lorem ipsum"));
+}
+
int
main (int argc,
char *argv[])
@@ -70,6 +79,7 @@ main (int argc,
g_test_add_func ("/Calls/util/protocol_prefix", (GTestFunc) test_protocol_prefix);
g_test_add_func ("/Calls/util/dtmf_tones", (GTestFunc) test_dtmf_tone_validity);
g_test_add_func ("/Calls/util/call_icon_names", (GTestFunc) test_call_icon_names);
+ g_test_add_func ("/Calls/util/null-or-empty-strings", (GTestFunc) test_null_empty_strings);
g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]