[geos-commits] r2686 - trunk/tests/xmltester

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Oct 22 12:30:51 EDT 2009


Author: strk
Date: 2009-10-22 12:30:50 -0400 (Thu, 22 Oct 2009)
New Revision: 2686

Modified:
   trunk/tests/xmltester/XMLTester.cpp
Log:
Don't segfault on EOF inside <op> tag


Modified: trunk/tests/xmltester/XMLTester.cpp
===================================================================
--- trunk/tests/xmltester/XMLTester.cpp	2009-10-20 16:59:30 UTC (rev 2685)
+++ trunk/tests/xmltester/XMLTester.cpp	2009-10-22 16:30:50 UTC (rev 2686)
@@ -709,7 +709,16 @@
 	tmp = opel->Attribute("arg4");
 	if ( tmp ) opArg4 = tmp;
 
-	opRes = opnode->FirstChild()->Value();
+	const TiXmlNode* resnode = opnode->FirstChild();
+	if ( ! resnode )
+	{
+		std::stringstream tmp;
+		tmp << "op of test " << testCount
+		    << " of case " << caseCount
+		    << " has no expected result child";
+		throw(runtime_error(tmp.str()));
+	}
+	opRes = resnode->Value();
 
 	// trim blanks
 	opRes=trimBlanks(opRes);



More information about the geos-commits mailing list