diff options
author | James Booth <boothj5@gmail.com> | 2014-01-19 17:20:31 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-01-19 17:20:31 +0000 |
commit | 69f2f4a16f44ae7f6ab94f39623f2f44dfa0a754 (patch) | |
tree | f7650f4730df674f7c335c2950114a89dd67aea4 /tests/test_preferences.c | |
parent | 5f25d99357bd126bbae99c585cc9d84c265b62fc (diff) | |
download | profani-tty-69f2f4a16f44ae7f6ab94f39623f2f44dfa0a754.tar.gz |
Use defaults for /statuses commands
Diffstat (limited to 'tests/test_preferences.c')
-rw-r--r-- | tests/test_preferences.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/test_preferences.c b/tests/test_preferences.c new file mode 100644 index 00000000..77aabc6f --- /dev/null +++ b/tests/test_preferences.c @@ -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(); +} |