tests: standardize naming convention

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.
This commit is contained in:
Michael Vetter
2026-02-28 12:41:33 +01:00
parent a7408a970e
commit e81435be06
53 changed files with 1601 additions and 1433 deletions

View File

@@ -6,7 +6,7 @@
#include "config/preferences.h"
void
statuses_console_defaults_to_all(void** state)
prefs_get_string__returns__all_for_console_default(void** state)
{
gchar* setting = prefs_get_string(PREF_STATUSES_CONSOLE);
@@ -16,7 +16,7 @@ statuses_console_defaults_to_all(void** state)
}
void
statuses_chat_defaults_to_all(void** state)
prefs_get_string__returns__none_for_chat_default(void** state)
{
gchar* setting = prefs_get_string(PREF_STATUSES_CHAT);
@@ -26,7 +26,7 @@ statuses_chat_defaults_to_all(void** state)
}
void
statuses_muc_defaults_to_all(void** state)
prefs_get_string__returns__none_for_muc_default(void** state)
{
gchar* setting = prefs_get_string(PREF_STATUSES_MUC);

View File

@@ -1,3 +1,8 @@
void statuses_console_defaults_to_all(void** state);
void statuses_chat_defaults_to_all(void** state);
void statuses_muc_defaults_to_all(void** state);
#ifndef TESTS_TEST_PREFERENCES_H
#define TESTS_TEST_PREFERENCES_H
void prefs_get_string__returns__all_for_console_default(void** state);
void prefs_get_string__returns__none_for_chat_default(void** state);
void prefs_get_string__returns__none_for_muc_default(void** state);
#endif