[libgda/LIBGDA_5.2] Vala-extensions: removed tests of bugy Gee.Traversable implementation



commit bc7ca68f154e7e2f4157c355ee829241bed01a34
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Sep 26 13:52:35 2018 -0500

    Vala-extensions: removed tests of bugy Gee.Traversable implementation
    
    Vala-extensions: has been removed from master and may will be
    in a next version of 5.2.x series.

 libgda/data/DataModelIterator.vala     | 32 ++++----------------------
 tests/vala/CheckDataModelIterator.vala |  6 ++---
 tests/vala/CheckTable.vala             | 42 ++++++++--------------------------
 tools/browser/Makefile.am              |  4 +++-
 4 files changed, 19 insertions(+), 65 deletions(-)
---
diff --git a/libgda/data/DataModelIterator.vala b/libgda/data/DataModelIterator.vala
index 09fcb3d3e..5a60ee437 100644
--- a/libgda/data/DataModelIterator.vala
+++ b/libgda/data/DataModelIterator.vala
@@ -89,6 +89,9 @@
                public bool read_only { get { return true; } }
                
                public bool next () {
+                       if (!has_next ()) {
+                               return false;
+                       }
                        if (!this.filtered) 
                        {
                                if (this._current_pos == -1)
@@ -118,6 +121,7 @@
                                        this.iter.invalidate_contents ();
                                return ret;
                        }
+                       return false;
                }
                
                public bool has_next () {
@@ -159,34 +163,6 @@
                        catch {}
                }
                
-               /**
-                * {@inheritDoc}
-                * 
-                * {@inheritDoc}<< BR >>
-                * << BR >>
-                * ''Implementation:'' This function returns an iterator that can iterate over YIELDED values
-                * by {@link [StreamFunc].
-                */
-               public Gee.Iterator<A> stream<A> (owned Gee.StreamFunc<Value?, A> f)
-               {
-                       var l = new Gee.ArrayList<A> ();
-                       try {
-                               for (int i = this.pos_init; i < this.maxpos; i++) {
-                                       int row = i / this.iter.data_model.get_n_columns ();
-                                       int col = i - row * this.iter.data_model.get_n_columns ();
-                                       Value v = this.iter.data_model.get_value_at (col, row);
-                                       var g = new Gee.Lazy<Value?>.from_value (v);
-                                       Gee.Lazy<A> s;
-                                       var r = f (Gee.Traversable.Stream.CONTINUE, g, out s);
-                                       if (r == Gee.Traversable.Stream.END)
-                                               break;
-                                       if (r == Gee.Traversable.Stream.YIELD) {
-                                               l.add (s);
-                                       }
-                               }
-                       } catch {}              
-                       return l.iterator ();
-               }
        }
  }
  
diff --git a/tests/vala/CheckDataModelIterator.vala b/tests/vala/CheckDataModelIterator.vala
index 576bbef16..da1b980b2 100644
--- a/tests/vala/CheckDataModelIterator.vala
+++ b/tests/vala/CheckDataModelIterator.vala
@@ -311,9 +311,9 @@ namespace Check {
                        var app = new Tests ();
                        failures += app.InitIter ();
                        failures += app.iterating ();
-                       failures += app.streaming ();
-                       failures += app.filtering ();
-                       failures += app.choping ();
+                       //failures += app.streaming ();
+                       // failures += app.filtering ();
+                       // failures += app.choping ();
                        return failures != 0 ? 1 : 0;
                }
        }
diff --git a/tests/vala/CheckTable.vala b/tests/vala/CheckTable.vala
index 661fb77f5..6aca26c03 100644
--- a/tests/vala/CheckTable.vala
+++ b/tests/vala/CheckTable.vala
@@ -30,37 +30,19 @@ namespace Check {
                {
                        try {
                                GLib.FileUtils.unlink("table.db");
-                               bool usepg = false;
                                try {
-                                       this.connection = Connection.open_from_string ("PostgreSQL",
-                                                                               "DB_NAME=test", null,
-                                                                               Gda.ConnectionOptions.NONE);
+                                       this.connection = Connection.open_from_string(
+                                                                       "SQLite", "DB_DIR=.;DB_NAME=table",
+                                                                       null,
+                                                                       Gda.ConnectionOptions.NONE);
                                        if (this.connection.is_opened ()) {
-                                               usepg = true;
-                                               stdout.printf ("Using PostgreSQL provider. "+
-                                                                               "Creating Database...\n");
-                                               init_pg ();
+                                               stdout.printf("Using SQLite provider. "+
+                                                                       "Creating Database...\n");
+                                               Init_sqlite ();
                                        }
                                }
-                               catch (Error e) {
-                                       GLib.message ("Not using PostgreSQL provider. Message: "
-                                                                       + e.message+"\n");
-                               }
-                               if (!usepg) {
-                                       try {
-                                               this.connection = Connection.open_from_string(
-                                                                               "SQLite", 
"DB_DIR=.;DB_NAME=table",
-                                                                               null,
-                                                                               Gda.ConnectionOptions.NONE);
-                                               if (this.connection.is_opened ()) {
-                                                       stdout.printf("Using SQLite provider. "+
-                                                                               "Creating Database...\n");
-                                                       Init_sqlite ();
-                                               }
-                                       }
-                                       catch (Error e) {
-                                               
-                                       }
+                               catch (Error e) {
+
                                }
                        }
                        catch (Error e) {
@@ -394,12 +376,6 @@ namespace Check {
                        a.update_meta = true;
                        a.update ();
                        stdout.printf ("Current Provider: %s", a.connection.get_provider ().get_name());
-                       // FIXME: execute test once PostgreSQL metastore is fixed
-                       if (a.connection.get_provider ().get_name() == "PostgreSQL") {
-                               stdout.printf ("PostgreSQL has deficient metastore update. Skiping\n");
-                               stdout.printf (">>>>>>>> TEST PASS <<<<<<<<<<<\n");
-                               return 0;
-                       }
                        try {
                                var rs = a.records;
                                stdout.printf (@"Records in DATABASE table: $(a.name)\n");
diff --git a/tools/browser/Makefile.am b/tools/browser/Makefile.am
index 0be3a1506..e70c18ce5 100644
--- a/tools/browser/Makefile.am
+++ b/tools/browser/Makefile.am
@@ -201,7 +201,9 @@ EXTRA_DIST = \
        $(Desktop_in_files) $(icons_DATA) $(appicons_DATA) \
        $(appdata_in_files)
 
-DISTCLEANFILES = $(desktop_DATA)
+DISTCLEANFILES = \
+       $(desktop_DATA) \
+       $(appdata_DATA)
 
 CLEANFILES = \
        marshal.h \


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