* test-mu-store.c: fix test case (gboolean vs MuExitCode)
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify it
|
||||
** under the terms of the GNU General Public License as published by the
|
||||
@ -95,24 +97,32 @@ test_mu_store_store_msg_and_count (void)
|
||||
g_assert_cmpuint (0,==,mu_store_count (store));
|
||||
|
||||
/* add one */
|
||||
msg = mu_msg_new_from_file (MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,", NULL, NULL);
|
||||
msg = mu_msg_new_from_file (
|
||||
MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,",
|
||||
NULL, NULL);
|
||||
g_assert (msg);
|
||||
g_assert_cmpuint (mu_store_store_msg (store, msg, TRUE), ==, TRUE);
|
||||
g_assert_cmpuint (1,==,mu_store_count (store));
|
||||
g_assert_cmpuint (TRUE,==,mu_store_contains_message
|
||||
(store, MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,"));
|
||||
(store,
|
||||
MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,"));
|
||||
mu_msg_unref (msg);
|
||||
|
||||
/* add another one */
|
||||
msg = mu_msg_new_from_file (MU_TESTMAILDIR2 "bar/cur/mail3", NULL, NULL);
|
||||
msg = mu_msg_new_from_file (MU_TESTMAILDIR2
|
||||
"bar/cur/mail3", NULL, NULL);
|
||||
g_assert (msg);
|
||||
g_assert_cmpuint (mu_store_store_msg (store, msg, TRUE), ==, TRUE);
|
||||
g_assert_cmpuint (2,==,mu_store_count (store));
|
||||
g_assert_cmpuint (TRUE,==,mu_store_contains_message (store, MU_TESTMAILDIR2 "bar/cur/mail3"));
|
||||
g_assert_cmpuint (TRUE,==,
|
||||
mu_store_contains_message (store, MU_TESTMAILDIR2
|
||||
"bar/cur/mail3"));
|
||||
mu_msg_unref (msg);
|
||||
|
||||
/* try to add the first one again. count should be 2 still */
|
||||
msg = mu_msg_new_from_file (MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,", NULL, NULL);
|
||||
msg = mu_msg_new_from_file
|
||||
(MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,",
|
||||
NULL, NULL);
|
||||
g_assert (msg);
|
||||
g_assert_cmpuint (mu_store_store_msg (store, msg, TRUE), ==, TRUE);
|
||||
g_assert_cmpuint (2,==,mu_store_count (store));
|
||||
@ -141,18 +151,21 @@ test_mu_store_store_msg_remove_and_count (void)
|
||||
|
||||
/* add one */
|
||||
err = NULL;
|
||||
msg = mu_msg_new_from_file (MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,",
|
||||
msg = mu_msg_new_from_file (
|
||||
MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,",
|
||||
NULL, &err);
|
||||
g_assert (msg);
|
||||
g_assert_cmpuint (mu_store_store_msg (store, msg, TRUE), ==, MU_OK);
|
||||
g_assert_cmpuint (mu_store_store_msg (store, msg, TRUE), ==, TRUE);
|
||||
g_assert_cmpuint (1,==,mu_store_count (store));
|
||||
mu_msg_unref (msg);
|
||||
|
||||
/* remove one */
|
||||
mu_store_remove_path (store, MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,");
|
||||
mu_store_remove_path (store,
|
||||
MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,");
|
||||
g_assert_cmpuint (0,==,mu_store_count (store));
|
||||
g_assert_cmpuint (FALSE,==,mu_store_contains_message
|
||||
(store, MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,"));
|
||||
(store,
|
||||
MU_TESTMAILDIR "cur/1283599333.1840_11.cthulhu!2,"));
|
||||
|
||||
mu_store_destroy (store);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user