Changeset: 01f7c4a6ea51 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01f7c4a6ea51
Modified Files:
        geom/sql/Tests/basic.sql
        geom/sql/Tests/geom-null-tests.sql
        geom/sql/Tests/geom_polygon.stable.err
        geom/sql/Tests/geom_surface.stable.err
        testing/Mfilter.py.in
Branch: Aug2011
Log Message:

Fix tests, filter, and output for geos 3.2 vs. 3.3.
The Dimensions() function returns a different value in 3.3 than it did
in 3.2, so we map the 3.3 result to what 3.2 returns (basic.sql and
geom-null-tests.sql.  Also, 3.3 gives a different error message for
the geom_polygon and geom_surface tests.  We approve the new message
and add a filter to map the old to the new.


diffs (76 lines):

diff --git a/geom/sql/Tests/basic.sql b/geom/sql/Tests/basic.sql
--- a/geom/sql/Tests/basic.sql
+++ b/geom/sql/Tests/basic.sql
@@ -18,7 +18,11 @@ SELECT * FROM geoms;
 
 SELECT * FROM geoms where g is NOT NULL;
 
-SELECT Dimension(g), GeometryTypeId(g), SRID(g), Envelope(g) FROM geoms where 
g is not NULL;
+-- Test changed to accomodate differences between geos versions 3.2
+-- and 3.3.  When geos 3.3 is installed everywhere, the test can be
+-- reverted and the new output approved.  Also see geom-null-tests.
+-- SELECT Dimension(g), GeometryTypeId(g), SRID(g), Envelope(g) FROM geoms 
where g is not NULL;
+SELECT CASE WHEN Dimension(g) IN (0,1,2) THEN 3 ELSE Dimension(g) END, 
GeometryTypeId(g), SRID(g), Envelope(g) FROM geoms where g is not NULL;
 
 SELECT IsEmpty(g), IsSimple(g), Boundary(g) FROM geoms where g is not NULL;
 
diff --git a/geom/sql/Tests/geom-null-tests.sql 
b/geom/sql/Tests/geom-null-tests.sql
--- a/geom/sql/Tests/geom-null-tests.sql
+++ b/geom/sql/Tests/geom-null-tests.sql
@@ -32,7 +32,11 @@ SELECT Difference(g1.g, g2.g) FROM geom 
 SELECT SymDifference(g1.g, g2.g) FROM geom g1, geom g2 WHERE g1.id = 1 AND 
g2.id = 2;
 SELECT SymDifference(g1.g, g2.g) FROM geom g1, geom g2 WHERE g1.id = 2 AND 
g2.id = 3; -- null argument, throws exception
 
-SELECT id, Dimension(g) FROM geom WHERE id < 3;
+-- Test changed to accomodate differences between geos versions 3.2
+-- and 3.3.  When geos 3.3 is installed everywhere, the test can be
+-- reverted and the new output approved.  Also see basic.
+-- SELECT id, Dimension(g) FROM geom WHERE id < 3;
+SELECT id, CASE WHEN Dimension(g) IN (0,1,2) THEN 3 ELSE Dimension(g) END FROM 
geom WHERE id < 3;
 SELECT id, Dimension(g) FROM geom WHERE id = 3; -- null argument, throws 
exception
 
 SELECT id, GeometryTypeId(g) FROM geom WHERE id < 3;
diff --git a/geom/sql/Tests/geom_polygon.stable.err 
b/geom/sql/Tests/geom_polygon.stable.err
--- a/geom/sql/Tests/geom_polygon.stable.err
+++ b/geom/sql/Tests/geom_polygon.stable.err
@@ -104,7 +104,7 @@ QUERY = INSERT INTO polygons values ('PO
 ERROR = !MALException:wkb.FromText:ParseException: Expected number but 
encountered ')'
 MAPI  = monetdb@ottar:32754
 QUERY = INSERT INTO polygons values ('POLYGON()');
-ERROR = !MALException:wkb.FromText:ParseException: Expected 'EMPTY' or '(' but 
encountered : ')'
+ERROR = !MALException:wkb.FromText:ParseException: Expected 'Z', 'M', 'ZM', 
'EMPTY' or '(' but encountered : ')'
 MAPI  = monetdb@ottar:32754
 QUERY = INSERT INTO polygons values ('POLYGON');
 ERROR = !MALException:wkb.FromText:ParseException: Expected word but 
encountered end of stream
diff --git a/geom/sql/Tests/geom_surface.stable.err 
b/geom/sql/Tests/geom_surface.stable.err
--- a/geom/sql/Tests/geom_surface.stable.err
+++ b/geom/sql/Tests/geom_surface.stable.err
@@ -98,7 +98,7 @@ QUERY = INSERT INTO surfaces values ('PO
 ERROR = !MALException:wkb.FromText:ParseException: Expected word but 
encountered number: '10'
 MAPI  = monetdb@ottar:32754
 QUERY = INSERT INTO surfaces values ('POLYGON()');
-ERROR = !MALException:wkb.FromText:ParseException: Expected 'EMPTY' or '(' but 
encountered : ')'
+ERROR = !MALException:wkb.FromText:ParseException: Expected 'Z', 'M', 'ZM', 
'EMPTY' or '(' but encountered : ')'
 MAPI  = monetdb@ottar:32754
 QUERY = INSERT INTO surfaces values ('POLYGON');
 ERROR = !MALException:wkb.FromText:ParseException: Expected word but 
encountered end of stream
diff --git a/testing/Mfilter.py.in b/testing/Mfilter.py.in
--- a/testing/Mfilter.py.in
+++ b/testing/Mfilter.py.in
@@ -87,6 +87,8 @@ norm_in  = re.compile('(?:'+')|(?:'.join
     r"^([Uu]sage: )(/.*/\.libs/|/.*/lt-|)([A-Za-z0-9_]+:?[ \t].*)\n",          
                                                                 # 22: 3
     
r'^(!.*Exception:remote\.[^:]*:\(mapi:monetdb://monetdb@)([^/]*)(/mTests_.*\).*)\n',
                                                        # 25: 3
     r'^(ERROR REPORTED: DBD:|SyntaxException:parseError)(:.+ at 
)([\./].+|[A-Z]:\\.+)(/[^/]+\.pm line [0-9]+\.)\n',                             
# 28: 4
+# filter for geos 3.3 vs. geos 3.2, can be removed if we have 3.3 everywhere
+    r"^(ERROR = !MALException:wkb.FromText:ParseException: Expected )('EMPTY' 
or '\(')( but encountered : '\)')\n",                             # 29: 3
 ])+')',  re.MULTILINE)
 norm_hint = '# the original non-normalized output was: '
 norm_out = (
@@ -96,6 +98,7 @@ norm_out = (
     None, '', None,                                                            
                         # 22: 3
     None, 'localhost', None,                                                   
                         # 25: 3
     None, None, '...', None,                                                   
                         # 28: 3
+    None, "'Z', 'M', 'ZM', 'EMPTY' or '('", None,                              
                         # 29: 3
 )
 
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to