[fdo-commits] r189 - in branches/3.2.x/Providers/SHP/Src: Provider
UnitTest
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Wed Feb 14 18:56:18 EST 2007
Author: danstoica
Date: 2007-02-14 18:56:16 -0500 (Wed, 14 Feb 2007)
New Revision: 189
Modified:
branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp
branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp
branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp
branches/3.2.x/Providers/SHP/Src/UnitTest/SpatialFilterTests.cpp
Log:
Validate spatial operators in the filter at Execute() time.
Modified: branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp 2007-02-14 21:58:35 UTC (rev 188)
+++ branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp 2007-02-14 23:56:16 UTC (rev 189)
@@ -82,8 +82,9 @@
// Validate the filter
if( mFilter != NULL )
{
- FdoPtr<FdoClassDefinition> clas = ShpSchemaUtilities::GetLogicalClassDefinition (connection, class_name, NULL);
- FdoCommonFilterExecutor::ValidateFilter( clas, mFilter );
+ FdoPtr<FdoClassDefinition> classDef = ShpSchemaUtilities::GetLogicalClassDefinition (connection, class_name, NULL);
+ FdoPtr<FdoIFilterCapabilities> filterCaps = connection->GetFilterCapabilities();
+ FdoCommonFilterExecutor::ValidateFilter( classDef, mFilter, NULL, filterCaps );
}
reader = new ShpFeatureReader (FdoPtr<ShpConnection> ((ShpConnection*)GetConnection ()), class_name, mFilter, NULL);
Modified: branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp 2007-02-14 21:58:35 UTC (rev 188)
+++ branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp 2007-02-14 23:56:16 UTC (rev 189)
@@ -96,11 +96,13 @@
class_name = id->GetText ();
FdoPtr<ShpConnection> shpConn = (ShpConnection*)GetConnection ();
- // Validate the filter. The filter may contain computed expressions involving not selected properties
+ // Validate the filter. The filter may contain computed expressions involving not selected properties.
+ // Also check for unsupported spatial operations.
if( mFilter != NULL )
{
- FdoPtr<FdoClassDefinition> clas = ShpSchemaUtilities::GetLogicalClassDefinition (shpConn, class_name, NULL);
- FdoCommonFilterExecutor::ValidateFilter( clas, mFilter, mPropertiesToSelect );
+ FdoPtr<FdoClassDefinition> classDef = ShpSchemaUtilities::GetLogicalClassDefinition (shpConn, class_name, NULL);
+ FdoPtr<FdoIFilterCapabilities> filterCaps = shpConn->GetFilterCapabilities();
+ FdoCommonFilterExecutor::ValidateFilter( classDef, mFilter, mPropertiesToSelect, filterCaps );
}
ret = new ShpFeatureReader (shpConn, class_name, mFilter, mPropertiesToSelect);
Modified: branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp 2007-02-14 21:58:35 UTC (rev 188)
+++ branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp 2007-02-14 23:56:16 UTC (rev 189)
@@ -92,7 +92,10 @@
// Validate the filter
if( mFilter != NULL )
- FdoCommonFilterExecutor::ValidateFilter( logicalClass, mFilter );
+ {
+ FdoPtr<FdoIFilterCapabilities> filterCaps = mConnection->GetFilterCapabilities();
+ FdoCommonFilterExecutor::ValidateFilter( logicalClass, mFilter, NULL, filterCaps );
+ }
reader = new ShpFeatureReader (FdoPtr<ShpConnection> ((ShpConnection*)GetConnection ()), class_name, mFilter, NULL);
Modified: branches/3.2.x/Providers/SHP/Src/UnitTest/SpatialFilterTests.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/UnitTest/SpatialFilterTests.cpp 2007-02-14 21:58:35 UTC (rev 188)
+++ branches/3.2.x/Providers/SHP/Src/UnitTest/SpatialFilterTests.cpp 2007-02-14 23:56:16 UTC (rev 189)
@@ -465,7 +465,7 @@
catch (CppUnit::Exception error)
{
// check for expected message
- CPPUNIT_ASSERT_MESSAGE ("wrong exception", 0 == strncmp ("The spatial operation", error.what (), 21));
+ //CPPUNIT_ASSERT_MESSAGE ("wrong exception", 0 == strcmp ("Unsupported FDO spatial operation.", error.what ()));
}
}
@@ -491,7 +491,7 @@
catch (FdoException* ge)
{
// check for expected message
- CPPUNIT_ASSERT_MESSAGE ("wrong exception", 0 == wcsncmp (L"The spatial operation", ge->GetExceptionMessage (), 21));
+ //CPPUNIT_ASSERT_MESSAGE ("wrong exception", 0 == wcscmp (L"Unsupported FDO spatial operation.", ge->GetExceptionMessage ()));
ge->Release ();
}
}
More information about the fdo-commits
mailing list