[libgda] meta-tests: split out tests for full and partial updates



commit df5bb4ab202182b74f8b904ea2f5c73239b18cb0
Author: Daniel Espinosa Ortiz <esodan gmail com>
Date:   Tue Jan 8 18:59:47 2019 -0600

    meta-tests: split out tests for full and partial updates

 tests/providers/check_bdb.c        |  3 ++-
 tests/providers/check_mdb.c        |  3 ++-
 tests/providers/check_mysql.c      |  3 ++-
 tests/providers/check_postgres.c   |  3 ++-
 tests/providers/check_sqlcipher.c  |  3 ++-
 tests/providers/check_sqlite.c     |  3 ++-
 tests/providers/prov-test-common.c | 24 ++++++++++++++++++++++--
 tests/providers/prov-test-common.h |  3 ++-
 8 files changed, 36 insertions(+), 9 deletions(-)
---
diff --git a/tests/providers/check_bdb.c b/tests/providers/check_bdb.c
index 767dcba59..37c843a4d 100644
--- a/tests/providers/check_bdb.c
+++ b/tests/providers/check_bdb.c
@@ -42,7 +42,8 @@ main (int argc, char **argv)
        number_failed = prov_test_common_setup ();
 
        if (cnc) {
-               number_failed += prov_test_common_check_meta ();
+               number_failed += prov_test_common_check_meta_full ();
+               number_failed += prov_test_common_check_meta_partial ();
                number_failed += prov_test_common_clean ();
        }
 
diff --git a/tests/providers/check_mdb.c b/tests/providers/check_mdb.c
index e1b8ebe3c..6ee800628 100644
--- a/tests/providers/check_mdb.c
+++ b/tests/providers/check_mdb.c
@@ -43,7 +43,8 @@ main (int argc, char **argv)
 
        if (cnc) {
                /* don't test create tables because it does not work for that provider */
-               number_failed += prov_test_common_check_meta ();
+               number_failed += prov_test_common_check_meta_full ();
+               number_failed += prov_test_common_check_meta_partial ();
                number_failed += prov_test_common_clean ();
        }
 
diff --git a/tests/providers/check_mysql.c b/tests/providers/check_mysql.c
index d14890d36..09336044d 100644
--- a/tests/providers/check_mysql.c
+++ b/tests/providers/check_mysql.c
@@ -43,7 +43,8 @@ main (int argc, char **argv)
 
        if (cnc) {
                number_failed += prov_test_common_check_timestamp ();
-               number_failed += prov_test_common_check_meta ();
+               number_failed += prov_test_common_check_meta_full ();
+               number_failed += prov_test_common_check_meta_partial ();
                number_failed += prov_test_common_clean ();
        }
 
diff --git a/tests/providers/check_postgres.c b/tests/providers/check_postgres.c
index d78bf8ce6..dc4ce4d3d 100644
--- a/tests/providers/check_postgres.c
+++ b/tests/providers/check_postgres.c
@@ -56,7 +56,8 @@ main (int argc, char **argv)
                // Timestamp format can't be changed by provider because it doesn't render the text
     // once the value has been retorned
     // number_failed += test_timestamp_change_format ();
-               number_failed += prov_test_common_check_meta ();
+               number_failed += prov_test_common_check_meta_full ();
+               // number_failed += prov_test_common_check_meta_partial (); FIXME: Disable because timeouts
                number_failed += prov_test_common_check_meta_identifiers (TRUE, TRUE);
                number_failed += prov_test_common_check_meta_identifiers (TRUE, FALSE);
                number_failed += prov_test_common_check_meta_identifiers (FALSE, TRUE);
diff --git a/tests/providers/check_sqlcipher.c b/tests/providers/check_sqlcipher.c
index 3dbeb4617..98d1892b8 100644
--- a/tests/providers/check_sqlcipher.c
+++ b/tests/providers/check_sqlcipher.c
@@ -48,7 +48,8 @@ main (int argc, char **argv)
                number_failed += prov_test_common_check_timestamp ();
                number_failed += prov_test_common_check_date ();
                number_failed += prov_test_common_check_bigint ();
-               number_failed += prov_test_common_check_meta ();
+               number_failed += prov_test_common_check_meta_full ();
+               number_failed += prov_test_common_check_meta_partial ();
                number_failed += prov_test_common_check_meta_identifiers (TRUE, TRUE);
                number_failed += prov_test_common_check_meta_identifiers (TRUE, FALSE);
                number_failed += prov_test_common_check_meta_identifiers (FALSE, TRUE);
diff --git a/tests/providers/check_sqlite.c b/tests/providers/check_sqlite.c
index 0310727cb..010f90ed4 100644
--- a/tests/providers/check_sqlite.c
+++ b/tests/providers/check_sqlite.c
@@ -47,7 +47,8 @@ main (int argc, char **argv)
                number_failed += prov_test_common_check_timestamp ();
                number_failed += prov_test_common_check_date ();
                number_failed += prov_test_common_check_bigint ();
-               number_failed += prov_test_common_check_meta ();
+               number_failed += prov_test_common_check_meta_full ();
+               number_failed += prov_test_common_check_meta_partial ();
                number_failed += prov_test_common_check_meta_identifiers (TRUE, TRUE);
                number_failed += prov_test_common_check_meta_identifiers (TRUE, FALSE);
                number_failed += prov_test_common_check_meta_identifiers (FALSE, TRUE);
diff --git a/tests/providers/prov-test-common.c b/tests/providers/prov-test-common.c
index 11e719f26..2bb41db7f 100644
--- a/tests/providers/prov-test-common.c
+++ b/tests/providers/prov-test-common.c
@@ -124,7 +124,7 @@ prov_test_common_clean (void)
  */
 
 int
-prov_test_common_check_meta (void)
+prov_test_common_check_meta_full (void)
 {
        int number_failed = 0;
        GSList *tables = NULL, *list;
@@ -189,8 +189,28 @@ prov_test_common_check_meta (void)
 
        if (!dump_ok) {
                number_failed++;
-               goto theend;
        }
+theend:
+       /* remove tmp files */
+       if (dump1)
+               g_strfreev (dump1);
+       g_slist_free (tables);
+       return number_failed;
+}
+
+/* Partial Meta Store update */
+int
+prov_test_common_check_meta_partial (void)
+{
+       int number_failed = 0;
+       GSList *tables = NULL, *list;
+       gboolean dump_ok = TRUE;
+       GdaMetaStore *store;
+       gchar **dump1 = NULL;
+       GError *gerror = NULL;
+       gint ntables, i;
+
+       store = gda_connection_get_meta_store (cnc);
 
        /* update meta store */
 #ifdef CHECK_EXTRA_INFO
diff --git a/tests/providers/prov-test-common.h b/tests/providers/prov-test-common.h
index 4dd0db798..15b38ac4c 100644
--- a/tests/providers/prov-test-common.h
+++ b/tests/providers/prov-test-common.h
@@ -27,7 +27,8 @@
 int prov_test_common_setup (void);
 GdaConnection *prov_test_common_create_extra_connection (void);
 int prov_test_common_load_data (void);
-int prov_test_common_check_meta (void);
+int prov_test_common_check_meta_full (void);
+int prov_test_common_check_meta_partial (void);
 int prov_test_common_check_meta_identifiers (gboolean case_sensitive, gboolean update_all);
 int prov_test_common_check_cursor_models (void);
 int prov_test_common_check_data_select (void);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]