diff options
| author | Milan Crha <mcrha@redhat.com> | 2019-03-12 16:17:37 +0100 |
|---|---|---|
| committer | Milan Crha <mcrha@redhat.com> | 2019-03-12 16:17:37 +0100 |
| commit | b8ed8a08d6f9dd7053f1d620e2548b88239fa0c2 (patch) | |
| tree | 6da659047bf2b1e6fdc220fee65a4182b91bf200 | |
| parent | b887e56e8dac1619ace1d4c1673c6ec9ccbf7375 (diff) | |
| download | evolution-data-server-b8ed8a08d6f9dd7053f1d620e2548b88239fa0c2.tar.gz | |
I#91 - Verify database presence in test-migration test
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/91
| -rw-r--r-- | tests/book-migration/test-migration.c | 15 |
1 files 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); } |
