about summary refs log tree commit diff stats
path: root/stabbertests/proftest.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-24 00:56:13 +0100
committerJames Booth <boothj5@gmail.com>2015-05-24 00:56:13 +0100
commit2241473ee62b7d5d60d20ef0c264e6080cbba8db (patch)
tree17b148c62e3e67d545a4522195381fb158254946 /stabbertests/proftest.c
parent520b2d259849edf43cfd7942a13d2e12aaec699a (diff)
downloadprofani-tty-2241473ee62b7d5d60d20ef0c264e6080cbba8db.tar.gz
Added bad password test
Diffstat (limited to 'stabbertests/proftest.c')
-rw-r--r--stabbertests/proftest.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/stabbertests/proftest.c b/stabbertests/proftest.c
index 6c44a6ee..e8409907 100644
--- a/stabbertests/proftest.c
+++ b/stabbertests/proftest.c
@@ -10,6 +10,8 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <stabber.h>
+
 #include "config.h"
 
 #include "config/preferences.h"
@@ -29,6 +31,9 @@
 #define XDG_CONFIG_HOME "./stabbertests/files/xdg_config_home"
 #define XDG_DATA_HOME   "./stabbertests/files/xdg_data_home"
 
+char *config_orig;
+char *data_orig;
+
 void
 prof_process_xmpp(void)
 {
@@ -141,6 +146,14 @@ _cleanup_dirs(void)
 void
 init_prof_test(void **state)
 {
+    if (stbbr_start(5230) != 0) {
+        assert_true(FALSE);
+        return;
+    }
+
+    config_orig = getenv("XDG_CONFIG_HOME");
+    data_orig = getenv("XDG_DATA_HOME");
+
     setenv("XDG_CONFIG_HOME", XDG_CONFIG_HOME, 1);
     setenv("XDG_DATA_HOME", XDG_DATA_HOME, 1);
 
@@ -196,4 +209,9 @@ close_prof_test(void **state)
     log_close();
 
     _cleanup_dirs();
+
+    setenv("XDG_CONFIG_HOME", config_orig, 1);
+    setenv("XDG_DATA_HOME", data_orig, 1);
+
+    stbbr_stop();
 }