[postgis-commits] svn - r3441 - trunk/doc/xsl

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Thu Dec 18 07:25:56 PST 2008


Author: robe
Date: 2008-12-18 07:25:54 -0800 (Thu, 18 Dec 2008)
New Revision: 3441

Modified:
   trunk/doc/xsl/postgis_gardentest.sql.xsl
Log:
Numerous enhancements to make torture script generator smarter - e.g. don't use geometry select when function takes not geometries, don't put monkey in when you see pattern matrix use a real intersectionmatrix, concept of version

Modified: trunk/doc/xsl/postgis_gardentest.sql.xsl
===================================================================
--- trunk/doc/xsl/postgis_gardentest.sql.xsl	2008-12-18 00:54:04 UTC (rev 3440)
+++ trunk/doc/xsl/postgis_gardentest.sql.xsl	2008-12-18 15:25:54 UTC (rev 3441)
@@ -13,15 +13,16 @@
 	<xsl:variable name='fnexclude'>ST_CurveToLine AddGeometryColumn DropGeometryColumn DropGeometryTable</xsl:variable>
 	<!--This is just a place holder to state functions not supported in 1.3 branch -->
 	<xsl:variable name='fnexclude13'>Populate_Geometry_Columns ST_IsValidReason</xsl:variable>	
-	<xsl:variable name='var_srid'>4269</xsl:variable>
+	<xsl:variable name='var_srid'>3395</xsl:variable>
 	<xsl:variable name='var_integer'>5</xsl:variable>
 	<xsl:variable name='var_float1'>0.5</xsl:variable>
 	<xsl:variable name='var_float2'>0.75</xsl:variable>
-	<xsl:variable name='var_version'>2</xsl:variable>
+	<xsl:variable name='var_version'>1</xsl:variable>
 	<xsl:variable name='var_NDRXDR'>XDR</xsl:variable>
 	<xsl:variable name='var_text'>'monkey'</xsl:variable>
 	<xsl:variable name='var_varchar'>'test'</xsl:variable>
 	<xsl:variable name='var_spheroid'>'SPHEROID["GRS_1980",6378137,298.257222101]'</xsl:variable>
+	<xsl:variable name='var_matrix'>'FF1FF0102'</xsl:variable>
 	<pgis:gardens>
 		<pgis:gset ID='PointSet' GeometryType='POINT'>(SELECT ST_SetSRID(ST_Point(i,j),4326) As the_geom 
 		FROM generate_series(-10,50,15) As i 
@@ -113,11 +114,11 @@
 				<xsl:variable name='fnargs'><xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template></xsl:variable>
 <!-- For each function prototype generate a test sql statement -->
 <xsl:choose>
-<!--Test functions that take no arguments -->
-	<xsl:when test="count(paramdef/parameter) = 0 and not(contains($fnexclude, at id))">SELECT  'Starting <xsl:value-of select="funcdef/function" />()';BEGIN; 
-SELECT  <xsl:value-of select="funcdef/function" />();
+<!--Test functions that take no arguments or take no geometries -->
+	<xsl:when test="(count(paramdef/parameter) = 0 or not(contains(paramdef[1]/type,'geometry') or contains(paramdef[2]/type,'geometry') or contains(paramdef[1]/parameter,'WKT') or contains(paramdef[1]/type,'box') or contains(paramdef[1]/type,'bytea'))) and not(contains($fnexclude,funcdef/function))">SELECT  'Starting <xsl:value-of select="funcdef/function" />(<xsl:value-of select="$fnargs" />)';BEGIN; 
+SELECT  <xsl:value-of select="funcdef/function" />(<xsl:value-of select="$fnfakeparams" />);
 COMMIT;
-SELECT  'Ending <xsl:value-of select="funcdef/function" />()';
+SELECT  'Ending <xsl:value-of select="funcdef/function" />(<xsl:value-of select="$fnargs" />)';
 	</xsl:when>
 <!--Start Test aggregate and unary functions -->
 <!--Garden Aggregator/Unary function with input gsets test -->
@@ -203,11 +204,15 @@
 	</xsl:template>
 	
 	<!--macro to replace func args with dummy var args -->
+	<!--macro to replace func args with dummy var args -->
 	<xsl:template name="replaceparams">
 		<xsl:param name="func" />
 		<xsl:for-each select="$func">
 			<xsl:for-each select="paramdef">
 				<xsl:choose>
+					<xsl:when test="contains(parameter, 'matrix') or contains(parameter, 'Matrix')"> 
+						<xsl:value-of select="$var_matrix" />
+					</xsl:when>
 					<xsl:when test="contains(parameter, 'srid')"> 
 						<xsl:value-of select="$var_srid" />
 					</xsl:when>
@@ -217,11 +222,17 @@
 					<xsl:when test="contains(parameter, 'version')"> 
 						<xsl:value-of select="$var_version" />
 					</xsl:when>
+					<xsl:when test="contains(type,'box') and position() = 1"> 
+						<xsl:text>foo1.the_geom</xsl:text>
+					</xsl:when>
 					<xsl:when test="contains(type,'box')"> 
+						<xsl:text>foo2.the_geom</xsl:text>
+					</xsl:when>
+					<xsl:when test="(type = 'geometry' or type = 'geometry ') and position() = 1"> 
 						<xsl:text>foo1.the_geom</xsl:text>
 					</xsl:when>
 					<xsl:when test="type = 'geometry' or type = 'geometry '"> 
-						<xsl:text>foo1.the_geom</xsl:text>
+						<xsl:text>foo2.the_geom</xsl:text>
 					</xsl:when>
 					<xsl:when test="contains(type, 'geometry[]')"> 
 						ARRAY[foo2.the_geom]



More information about the postgis-commits mailing list