mirror of https://github.com/djcb/mu.git
* lib: fix broken unit test
This commit is contained in:
parent
a655640e7b
commit
599d641034
|
@ -36,11 +36,21 @@
|
||||||
char*
|
char*
|
||||||
test_mu_common_get_random_tmpdir (void)
|
test_mu_common_get_random_tmpdir (void)
|
||||||
{
|
{
|
||||||
return g_strdup_printf ("%s%cmu-test-%d%ctest-%x", g_get_tmp_dir(),
|
char*dir;
|
||||||
G_DIR_SEPARATOR,
|
int res;
|
||||||
getuid(),
|
|
||||||
G_DIR_SEPARATOR,
|
dir = g_strdup_printf (
|
||||||
(int)random()*getpid()*(int)time(NULL));
|
"%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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ test_mu_store_new_destroy (void)
|
||||||
|
|
||||||
err = NULL;
|
err = NULL;
|
||||||
store = mu_store_new_writable (tmpdir, NULL, FALSE, &err);
|
store = mu_store_new_writable (tmpdir, NULL, FALSE, &err);
|
||||||
|
g_assert_no_error (err);
|
||||||
g_assert (store);
|
g_assert (store);
|
||||||
g_assert (err == NULL);
|
|
||||||
|
|
||||||
g_assert_cmpuint (0,==,mu_store_count (store, NULL));
|
g_assert_cmpuint (0,==,mu_store_count (store, NULL));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue