From f284641710bd25232676893327b5d46968ca481b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 31 Mar 2022 11:22:14 +0200 Subject: less duplication Print error message from `_string_matches_one_of()` instead of forming an error message manually that contains the same entries that were checked in `_string_matches_one_of()`. Signed-off-by: Steffen Jaeckel --- tests/unittests/test_cmd_account.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/unittests') diff --git a/tests/unittests/test_cmd_account.c b/tests/unittests/test_cmd_account.c index 69721311..c0eac0e3 100644 --- a/tests/unittests/test_cmd_account.c +++ b/tests/unittests/test_cmd_account.c @@ -571,7 +571,8 @@ cmd_account_show_message_for_invalid_otr_policy(void** state) expect_any(accounts_account_exists, account_name); will_return(accounts_account_exists, TRUE); - expect_cons_show("OTR policy must be one of: manual, opportunistic or always."); + expect_cons_show("Invalid OTR policy: 'bad_otr_policy'"); + expect_cons_show("OTR policy must be one of: 'manual', 'opportunistic' or 'always'."); gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args); assert_true(result); -- cgit 1.4.1-2-gfad0 From 8ffd8079da8c6e76e043d43a764e43831df59dd3 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 8 Apr 2022 10:14:29 +0200 Subject: Fix preferences tests --- tests/unittests/test_preferences.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unittests') diff --git a/tests/unittests/test_preferences.c b/tests/unittests/test_preferences.c index f3fe8e3e..ae158ebe 100644 --- a/tests/unittests/test_preferences.c +++ b/tests/unittests/test_preferences.c @@ -24,7 +24,7 @@ statuses_chat_defaults_to_all(void** state) char* setting = prefs_get_string(PREF_STATUSES_CHAT); assert_non_null(setting); - assert_string_equal("all", setting); + assert_string_equal("none", setting); g_free(setting); } @@ -34,6 +34,6 @@ statuses_muc_defaults_to_all(void** state) char* setting = prefs_get_string(PREF_STATUSES_MUC); assert_non_null(setting); - assert_string_equal("all", setting); + assert_string_equal("none", setting); g_free(setting); } -- cgit 1.4.1-2-gfad0