mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 10:56:21 +00:00
Use a behavior-driven naming convention for unit tests. Functions are now named using the pattern: [unit]__[verb]__[scenario] The __ works as a semantic separator. Examples: * jid_create__returns__null_from_null() * cmd_connect__shows__usage_when_no_server_value Benefits: * Easy to find all tests associated with a specific function using the mandatory prefix. * Test output in CI now explicitly describes the unit, the expected outcome, and the scenario being tested. Also disabled keyhandlers tests due to missing code in src/ui.
37 lines
796 B
C
37 lines
796 B
C
#include "prof_cmocka.h"
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <glib.h>
|
|
|
|
#include "config/preferences.h"
|
|
|
|
void
|
|
prefs_get_string__returns__all_for_console_default(void** state)
|
|
{
|
|
gchar* setting = prefs_get_string(PREF_STATUSES_CONSOLE);
|
|
|
|
assert_non_null(setting);
|
|
assert_string_equal("all", setting);
|
|
g_free(setting);
|
|
}
|
|
|
|
void
|
|
prefs_get_string__returns__none_for_chat_default(void** state)
|
|
{
|
|
gchar* setting = prefs_get_string(PREF_STATUSES_CHAT);
|
|
|
|
assert_non_null(setting);
|
|
assert_string_equal("none", setting);
|
|
g_free(setting);
|
|
}
|
|
|
|
void
|
|
prefs_get_string__returns__none_for_muc_default(void** state)
|
|
{
|
|
gchar* setting = prefs_get_string(PREF_STATUSES_MUC);
|
|
|
|
assert_non_null(setting);
|
|
assert_string_equal("none", setting);
|
|
g_free(setting);
|
|
}
|