Use defaults for /statuses commands

This commit is contained in:
James Booth
2014-01-19 17:20:31 +00:00
parent 5f25d99357
commit 69f2f4a16f
6 changed files with 63 additions and 3 deletions

41
tests/test_preferences.c Normal file
View File

@@ -0,0 +1,41 @@
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "config/preferences.h"
void statuses_console_defaults_to_all(void **state)
{
prefs_load();
char *setting = prefs_get_string(PREF_STATUSES_CONSOLE);
assert_non_null(setting);
assert_string_equal("all", setting);
prefs_close();
}
void statuses_chat_defaults_to_all(void **state)
{
prefs_load();
char *setting = prefs_get_string(PREF_STATUSES_CHAT);
assert_non_null(setting);
assert_string_equal("all", setting);
prefs_close();
}
void statuses_muc_defaults_to_on(void **state)
{
prefs_load();
gboolean setting = prefs_get_boolean(PREF_STATUSES_MUC);
assert_true(setting);
prefs_close();
}