[geos-commits] r3531 - branches/3.3/tests/xmltester

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Dec 9 03:46:06 EST 2011


Author: strk
Date: 2011-12-09 00:46:06 -0800 (Fri, 09 Dec 2011)
New Revision: 3531

Modified:
   branches/3.3/tests/xmltester/XMLTester.cpp
Log:
Allow XML tests not to specify a precision model, defaulting to floating

This allows running some JTS tests w/out touching them

Modified: branches/3.3/tests/xmltester/XMLTester.cpp
===================================================================
--- branches/3.3/tests/xmltester/XMLTester.cpp	2011-12-07 15:13:29 UTC (rev 3530)
+++ branches/3.3/tests/xmltester/XMLTester.cpp	2011-12-09 08:46:06 UTC (rev 3531)
@@ -418,6 +418,8 @@
 void
 XMLTester::parseRun(const TiXmlNode* node)
 {
+	using geos::geom::PrecisionModel;
+
 	assert(node);
 
 	//dump_to_stdout(node);
@@ -425,7 +427,19 @@
 	// Look for precisionModel element
 	const TiXmlElement* el = node->FirstChildElement("precisionModel");
 	if ( el ) parsePrecisionModel(el);
+	else pm.reset(new PrecisionModel());
 
+	if (verbose > 1)
+	{
+		std::cerr << *curr_file <<": run: Precision Model: " << pm->toString() <<std::endl;
+	}
+
+	factory.reset(new geom::GeometryFactory(pm.get()));
+	wktreader.reset(new io::WKTReader(factory.get()));
+	wktwriter.reset(new io::WKTWriter());
+	wkbreader.reset(new io::WKBReader(*factory));
+	wkbwriter.reset(new io::WKBWriter());
+
 	const TiXmlNode* casenode;
 	for ( casenode = node->FirstChild("case");
 	      casenode;
@@ -480,17 +494,6 @@
 		// NOTE: PrecisionModel discards offsets anyway...
 		pm.reset(new PrecisionModel(scale, offsetX, offsetY));
 	}
-
-	if (verbose > 1)
-	{
-		std::cerr << *curr_file <<": run: Precision Model: " << pm->toString() <<std::endl;
-	}
-
-	factory.reset(new geom::GeometryFactory(pm.get()));
-	wktreader.reset(new io::WKTReader(factory.get()));
-	wktwriter.reset(new io::WKTWriter());
-	wkbreader.reset(new io::WKBReader(*factory));
-	wkbwriter.reset(new io::WKBWriter());
 }
 
 



More information about the geos-commits mailing list