* lib: fix broken unit test

This commit is contained in:
djcb 2014-01-15 21:27:18 +02:00
parent a655640e7b
commit 599d641034
2 changed files with 16 additions and 6 deletions

View File

@ -36,11 +36,21 @@
char*
test_mu_common_get_random_tmpdir (void)
{
return g_strdup_printf ("%s%cmu-test-%d%ctest-%x", g_get_tmp_dir(),
G_DIR_SEPARATOR,
getuid(),
G_DIR_SEPARATOR,
(int)random()*getpid()*(int)time(NULL));
char*dir;
int res;
dir = g_strdup_printf (
"%s%cmu-test-%d%ctest-%x",
g_get_tmp_dir(),
G_DIR_SEPARATOR,
getuid(),
G_DIR_SEPARATOR,
(int)random()*getpid()*(int)time(NULL));
res = g_mkdir_with_parents (dir, 0700);
g_assert (res != -1);
return dir;
}

View File

@ -45,8 +45,8 @@ test_mu_store_new_destroy (void)
err = NULL;
store = mu_store_new_writable (tmpdir, NULL, FALSE, &err);
g_assert_no_error (err);
g_assert (store);
g_assert (err == NULL);
g_assert_cmpuint (0,==,mu_store_count (store, NULL));