[libadwaita/ebassi/toast-format: 29/31] tests: Add unit for adw_toast_new_format()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/ebassi/toast-format: 29/31] tests: Add unit for adw_toast_new_format()
- Date: Mon, 4 Apr 2022 11:37:14 +0000 (UTC)
commit 5a76d001458d7bb8d559ad17284df5bd6a8c43ed
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Feb 28 17:14:27 2022 +0000
tests: Add unit for adw_toast_new_format()
tests/test-toast.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/tests/test-toast.c b/tests/test-toast.c
index 26bdc59d..af0e6995 100644
--- a/tests/test-toast.c
+++ b/tests/test-toast.c
@@ -42,6 +42,24 @@ test_adw_toast_title (void)
g_assert_finalize_object (toast);
}
+static void
+test_adw_toast_title_format (void)
+{
+ AdwToast *toast;
+ const int n_value = 42;
+ char *title;
+
+ toast = adw_toast_new_format ("Title %d", n_value);
+
+ g_assert_nonnull (toast);
+
+ g_object_get (toast, "title", &title, NULL);
+ g_assert_cmpstr (title, ==, "Title 42");
+
+ g_free (title);
+ g_assert_finalize_object (toast);
+}
+
static void
test_adw_toast_button_label (void)
{
@@ -224,6 +242,7 @@ main (int argc,
adw_init ();
g_test_add_func ("/Adwaita/Toast/title", test_adw_toast_title);
+ g_test_add_func ("/Adwaita/Toast/title_format", test_adw_toast_title_format);
g_test_add_func ("/Adwaita/Toast/button_label", test_adw_toast_button_label);
g_test_add_func ("/Adwaita/Toast/action_name", test_adw_toast_action_name);
g_test_add_func ("/Adwaita/Toast/action_target", test_adw_toast_action_target);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]