[evolution-data-server] I#91 - Verify database presence in test-migration test
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] I#91 - Verify database presence in test-migration test
- Date: Tue, 12 Mar 2019 15:17:05 +0000 (UTC)
commit b8ed8a08d6f9dd7053f1d620e2548b88239fa0c2
Author: Milan Crha <mcrha redhat com>
Date: Tue Mar 12 16:17:37 2019 +0100
I#91 - Verify database presence in test-migration test
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/91
tests/book-migration/test-migration.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/tests/book-migration/test-migration.c b/tests/book-migration/test-migration.c
index 81eb7eeeb..172efa618 100644
--- a/tests/book-migration/test-migration.c
+++ b/tests/book-migration/test-migration.c
@@ -337,10 +337,15 @@ list_migration_sandboxes (void)
EDS_TEST_SQLITE_BOOKS, error->message);
while ((filename = g_dir_read_name (dir)) != NULL) {
-
gchar *fullpath = g_build_filename (EDS_TEST_SQLITE_BOOKS, filename, NULL);
+ gchar *old_bdb, *new_contactsdb;
+
+ old_bdb = g_build_filename (fullpath, "addressbook.dump", NULL);
+ new_contactsdb = g_build_filename (fullpath, "contacts.db", NULL);
- if (g_file_test (fullpath, G_FILE_TEST_IS_DIR)) {
+ if (g_file_test (fullpath, G_FILE_TEST_IS_DIR) && (
+ g_file_test (old_bdb, G_FILE_TEST_IS_REGULAR) ||
+ g_file_test (new_contactsdb, G_FILE_TEST_IS_REGULAR))) {
#if defined (TEST_VERSIONS_WITH_BDB)
sandboxes = g_list_prepend (sandboxes, g_strdup (filename));
@@ -349,15 +354,13 @@ list_migration_sandboxes (void)
* is the case then we skip the migration tests from versions of EDS where we
* used Berkeley DB
*/
- gchar *old_bdb = g_build_filename (EDS_TEST_SQLITE_BOOKS, filename,
"addressbook.dump", NULL);
-
if (!g_file_test (old_bdb, G_FILE_TEST_EXISTS))
sandboxes = g_list_prepend (sandboxes, g_strdup (filename));
-
- g_free (old_bdb);
#endif
}
+ g_free (old_bdb);
+ g_free (new_contactsdb);
g_free (fullpath);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]