[fdo-commits] r799 - in
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest: . Common Odbc
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Tue Mar 20 12:02:22 EDT 2007
Author: brentrobinson
Date: 2007-03-20 12:02:21 -0400 (Tue, 20 Mar 2007)
New Revision: 799
Modified:
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.cpp
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.h
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.cpp
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.h
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.cpp
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.h
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.cpp
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.h
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.cpp
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.h
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.h
branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/UnitTestMySql.vcproj
Log:
Added more test cases
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.cpp
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.cpp 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.cpp 2007-03-20 16:02:21 UTC (rev 799)
@@ -94,7 +94,7 @@
FdoLockType* lockTypes = connectionCapabilities->GetLockTypes( size );
printf("SIZE = %d\n", size);
- CPPUNIT_ASSERT( size == 0 );
+ CPPUNIT_ASSERT( size == GetLockTypeCount() );
for (i = 0; i < size; i++) {
@@ -128,8 +128,8 @@
} // for ( ...
- //for ( i = 0; i < size; i++ )
- // CPPUNIT_ASSERT( lockArray[i] );
+ for ( i = 0; i < size; i++ )
+ CPPUNIT_ASSERT( lockArray[i] );
FdoPtr<FdoICommandCapabilities> commandCapabilities = connection->GetCommandCapabilities();
FdoInt32 *commands = commandCapabilities->GetCommands(size);
@@ -763,6 +763,10 @@
} // GetUnexpectedFlagValueErrorString ()
+FdoInt32 FdoCapabilityTest::GetLockTypeCount()
+{
+ return 0;
+}
FdoCapabilityTest::ArgObject *FdoCapabilityTest::InitArgument (
FdoString *argName,
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.h
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.h 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoCapabilityTest.h 2007-03-20 16:02:21 UTC (rev 799)
@@ -264,6 +264,11 @@
bool expected_value,
bool actualValue);
+ // GetLockTypeCount:
+ // The function returns the number of lock types supported by the current provider.
+
+ virtual FdoInt32 GetLockTypeCount();
+
// InitArgument:
// The function creates a new object of type "ArgObject",
// initializes it using the provided data and returns it back
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.cpp
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.cpp 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.cpp 2007-03-20 16:02:21 UTC (rev 799)
@@ -186,3 +186,18 @@
CPPUNIT_FAIL("Unknown exception");
}
}
+
+void FdoConnectTest::connectWithExtraneousSpaces()
+{
+ wchar_t *wConnection = UnitTestUtil::GetConnectionString(Connection_WithDatastore, L"", true);
+
+ FdoPtr<FdoIConnection> connection = UnitTestUtil::GetProviderConnectionObject();
+ connection->SetConnectionString (wConnection);
+ FdoPtr<FdoIConnectionInfo> connInfo = connection->GetConnectionInfo();
+ FdoPtr<FdoIConnectionPropertyDictionary> connDict = connInfo->GetConnectionProperties();
+ if( connection->Open() != FdoConnectionState_Open )
+ {
+ connection->Close();
+ throw "connectWithExtraneousSpaces failed";
+ }
+}
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.h
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.h 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectTest.h 2007-03-20 16:02:21 UTC (rev 799)
@@ -26,6 +26,7 @@
CPPUNIT_TEST ( connectPropDictionaryTest );
CPPUNIT_TEST ( connectWithInvalidString );
CPPUNIT_TEST( query );
+ CPPUNIT_TEST( connectWithExtraneousSpaces );
CPPUNIT_TEST_SUITE_END();
public:
@@ -40,6 +41,7 @@
virtual void query ();
virtual void connectPropDictionaryTest(){};
virtual void connectWithInvalidString();
+ virtual void connectWithExtraneousSpaces();
FdoPtr<FdoIConnection> mConnection;
void ReadAcDbPolyline( int connNumber, FdoIFeatureReader *myReader );
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.cpp
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.cpp 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.cpp 2007-03-20 16:02:21 UTC (rev 799)
@@ -86,6 +86,18 @@
}
+void FdoConnectionInfoTest::CheckProviderInfo ()
+{
+ FdoPtr<FdoIConnectionInfo> connectionInfo =
+ mConnection->GetConnectionInfo();
+
+ FdoString* featureDataObjectsVersion = connectionInfo->GetFeatureDataObjectsVersion();
+ FdoString* providerDescription = connectionInfo->GetProviderDescription();
+ FdoString* providerName = connectionInfo->GetProviderName();
+ FdoString* providerVersion = connectionInfo->GetProviderVersion();
+
+} // CheckDatabaseBasedProviderInfo ()
+
void FdoConnectionInfoTest::CheckDatabaseBasedProviderInfo ()
{
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.h
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.h 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConnectionInfoTest.h 2007-03-20 16:02:21 UTC (rev 799)
@@ -60,6 +60,7 @@
void AddFileNameToList (FdoStringP fileName);
void ClearFileNameList ();
+ void CheckProviderInfo ();
void CheckDatabaseBasedProviderInfo ();
void CheckFileBasedProviderInfo ();
void CheckList (FdoStringP dependentFileName);
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.cpp
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.cpp 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.cpp 2007-03-20 16:02:21 UTC (rev 799)
@@ -36,28 +36,26 @@
set_provider();
}
-FdoIConnection* FdoConstraintsTest::CreateConnection( FdoBoolean recreateDb )
+void FdoConstraintsTest::CreateConnection( Context& context, FdoBoolean recreateDb )
{
- FdoIConnection* connection;
-
FdoBoolean lRecreateDb = recreateDb && RECREATE_CONSTRAINTS_DB;
FdoBoolean destroySchema = recreateDb && !RECREATE_CONSTRAINTS_DB;
// delete, re-create and open the datastore
- connection = UnitTestUtil::CreateConnection(
+ context.connection = UnitTestUtil::CreateConnection(
lRecreateDb,
lRecreateDb,
DB_NAME_CONSTRAINTS_SUFFIX,
NULL,
NULL,
- 0
+ context.ltMethod
);
if ( destroySchema ) {
try {
// Drop the schema
- FdoPtr<FdoIDestroySchema> pCmd = (FdoIDestroySchema*) connection->CreateCommand(FdoCommandType_DestroySchema);
- FdoPtr<FdoIDescribeSchema> pDescCmd = (FdoIDescribeSchema*) connection->CreateCommand(FdoCommandType_DescribeSchema);
+ FdoPtr<FdoIDestroySchema> pCmd = (FdoIDestroySchema*) context.connection->CreateCommand(FdoCommandType_DestroySchema);
+ FdoPtr<FdoIDescribeSchema> pDescCmd = (FdoIDescribeSchema*) context.connection->CreateCommand(FdoCommandType_DescribeSchema);
FdoFeatureSchemasP schemas = pDescCmd->Execute();
FdoInt32 idx;
for ( idx = 0; idx < schemas->GetCount(); idx++ ) {
@@ -68,8 +66,6 @@
// ignore
}
}
-
- return connection;
}
void FdoConstraintsTest::TestParser()
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.h
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.h 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoConstraintsTest.h 2007-03-20 16:02:21 UTC (rev 799)
@@ -41,7 +41,7 @@
void setUp();
protected:
- virtual FdoIConnection* CreateConnection( FdoBoolean recreateDb = false );
+ virtual void CreateConnection( Context& context, FdoBoolean recreateDb = false );
virtual FdoBoolean CanRestrictCheckConstraint();
virtual FdoDouble GetDoubleRounding( FdoDataType dataType );
virtual void set_provider() {};
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.cpp
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.cpp 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.cpp 2007-03-20 16:02:21 UTC (rev 799)
@@ -17,6 +17,7 @@
#include "Pch.h"
#include "FdoSelectTest.h"
#include "UnitTestUtil.h"
+#include "FdoSpatial.h"
//#include <Geometry/GeometryStd.h>
//#include <Geometry/Fgf/Factory.h>
//#include "FdoGeometry.h"
@@ -430,38 +431,79 @@
{
try
{
- selCmd = (FdoISelect*)mConnection->CreateCommand( FdoCommandType_Select );
- selCmd->SetFeatureClassName(L"Acad:AcDb3dPolyline");
- FdoPtr<FdoFilter> filterPtr = FdoSelectTest::CreateFilter();
- double coords[6];
- double distance = 300.0;
- coords[0] = 1410804.854546;
- coords[1] = 553505.994735;
- coords[2] = 0.0;
- coords[3] = 1412350.770162;
- coords[4] = 554980.139631;
- coords[5] = 0.0;
- FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
- FdoPtr<FdoILineString> line1 = gf->CreateLineString(FdoDimensionality_XY|FdoDimensionality_Z, 2*3, coords);
- FdoPtr<FdoByteArray> byteArray = gf->GetFgf(line1);
+ FdoInt32 size;
- FdoPtr<FdoGeometryValue> geomValue = FdoPtr<FdoGeometryValue>( FdoGeometryValue::Create(byteArray));
- FdoPtr<FdoDistanceCondition> pSpatialFilter = FdoPtr<FdoDistanceCondition>( FdoDistanceCondition::Create(L"Geometry",
- FdoDistanceOperations_Within,
- geomValue,
- distance ));
- FdoPtr<FdoFilter> filter = FdoFilter::Combine( filterPtr, FdoBinaryLogicalOperations_And, pSpatialFilter);
- selCmd->SetFilter(filter);
+ FdoPtr<FdoIFilterCapabilities> filterCapabilities = mConnection->GetFilterCapabilities();
+ FdoDistanceOperations *distanceOperations = filterCapabilities->GetDistanceOperations(size);
- myReader = selCmd->Execute();
- if( myReader != NULL )
+ // Do test only if provider supports distance filters.
+ if ( size > 0 )
{
- while ( myReader->ReadNext() )
+ selCmd = (FdoISelect*)mConnection->CreateCommand( FdoCommandType_Select );
+ selCmd->SetFeatureClassName(L"Acad:AcDb3dPolyline");
+ FdoPtr<FdoFilter> filterPtr = FdoSelectTest::CreateFilter();
+ double coords[6];
+ double distance = 300.0;
+ coords[0] = 1410804.854546;
+ coords[1] = 553505.994735;
+ coords[2] = 0.0;
+ coords[3] = 1412350.770162;
+ coords[4] = 554980.139631;
+ coords[5] = 0.0;
+ FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
+ FdoPtr<FdoILineString> line1 = gf->CreateLineString(FdoDimensionality_XY|FdoDimensionality_Z, 2*3, coords);
+ FdoPtr<FdoByteArray> byteArray = gf->GetFgf(line1);
+
+ FdoPtr<FdoGeometryValue> geomValue = FdoPtr<FdoGeometryValue>( FdoGeometryValue::Create(byteArray));
+ FdoPtr<FdoDistanceCondition> pSpatialFilter = FdoPtr<FdoDistanceCondition>( FdoDistanceCondition::Create(L"Geometry",
+ FdoDistanceOperations_Within,
+ geomValue,
+ distance ));
+ FdoPtr<FdoFilter> filter = FdoFilter::Combine( filterPtr, FdoBinaryLogicalOperations_And, pSpatialFilter);
+ selCmd->SetFilter(filter);
+
+ myReader = selCmd->Execute();
+ if( myReader != NULL )
{
- read_feature_data( myReader );
+ while ( myReader->ReadNext() )
+ {
+ read_feature_data( myReader );
+ }
}
+
+ // Try the same query again, but with a dimensionality mismatch between filter and selected geometries.
+ selCmd = (FdoISelect*)mConnection->CreateCommand( FdoCommandType_Select );
+ selCmd->SetFeatureClassName(L"Acad:AcDb3dPolyline");
+ filterPtr = CreateFilter();
+ double coords2[4];
+ coords2[0] = 1410804.854546;
+ coords2[1] = 553505.994735;
+ coords2[2] = 1412350.770162;
+ coords2[3] = 554980.139631;
+ line1 = gf->CreateLineString(FdoDimensionality_XY, 4, coords2);
+ byteArray = gf->GetFgf(line1);
+ printf("Testing DistanceCondition with 2D geometry:\n<<%ls>>\n", line1->GetText());
+
+ geomValue = FdoPtr<FdoGeometryValue>( FdoGeometryValue::Create(byteArray));
+ pSpatialFilter = FdoPtr<FdoDistanceCondition>( FdoDistanceCondition::Create(L"Geometry",
+ FdoDistanceOperations_Within,
+ geomValue,
+ distance ));
+ filter = FdoFilter::Combine( filterPtr, FdoBinaryLogicalOperations_And, pSpatialFilter);
+ selCmd->SetFilter(filter);
+
+ FdoInt32 numRows = 0;
+ myReader = selCmd->Execute();
+ if( myReader != NULL )
+ {
+ while ( myReader->ReadNext() )
+ {
+ numRows++;
+ read_feature_data( myReader );
+ }
+ }
+ printf("Read %d rows.\n", numRows);
}
-
}
catch( FdoException *ex )
{
@@ -517,6 +559,169 @@
}
}
+void FdoSelectTest::spatial_query_defect792377()
+{
+ FdoPtr<FdoIFeatureReader> myReader;
+ FdoPtr<FdoISelect> selCmd;
+
+ if( mConnection != NULL )
+ {
+ try
+ {
+ FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
+ selCmd = (FdoISelect*)mConnection->CreateCommand( FdoCommandType_Select );
+ selCmd->SetFeatureClassName(L"Acad:AcDb3dPolyline");
+ FdoPtr<FdoFilter> filterPtr = CreateFilter();
+
+ // We want a geometry with more than 999 ordinates, which is a limit imposed
+ // by the Oracle parser. This makes sure that we are binding geometries in
+ // spatial filters -- binding can be done with any legal geometry.
+ // The easiest way to create one here is to linearise a circular arc.
+
+ FdoString * geomText = L"CURVEPOLYGON XYZ ((1410804.854546 553505.994735 0 (CIRCULARARCSEGMENT (1412350.770162 554980.139631 0, 1410804.854546 553505.994735 0))))";
+ FdoPtr<FdoIGeometry> geom = gf->CreateGeometry(geomText);
+
+ FdoPtr<FdoIGeometry> linearizedGeom =
+ FdoSpatialUtility::ApproximateGeometryWithLineStrings(geom, 0, 0.001, gf);
+
+ FdoGeometryType geomType = linearizedGeom->GetDerivedType();
+ CPPUNIT_ASSERT( geomType == FdoGeometryType_Polygon );
+ FdoIPolygon * poly = static_cast<FdoIPolygon *>(linearizedGeom.p);
+ FdoPtr<FdoILinearRing> ring = poly->GetExteriorRing();
+ FdoInt32 numPositions = ring->GetCount();
+ CPPUNIT_ASSERT( numPositions > 333 );
+
+ FdoPtr<FdoGeometryValue> geomValue = FdoPtr<FdoGeometryValue>(FdoGeometryValue::Create(FdoPtr<FdoByteArray>(gf->GetFgf(linearizedGeom))));
+ FdoPtr<FdoSpatialCondition> pSpatialFilter = FdoPtr<FdoSpatialCondition>(FdoSpatialCondition::Create(L"Geometry",
+ FdoSpatialOperations_Intersects,
+ geomValue));
+
+ FdoPtr<FdoFilter> filter = FdoFilter::Combine( filterPtr, FdoBinaryLogicalOperations_And, pSpatialFilter);
+ selCmd->SetFilter(filter);
+
+ FdoInt32 numFeatures = 0;
+
+ myReader = selCmd->Execute();
+ if( myReader != NULL )
+ {
+ while ( myReader->ReadNext() )
+ {
+ numFeatures++;
+ read_feature_data( myReader );
+ }
+ }
+ printf(" %i feature(s) read\n", numFeatures);
+ }
+ catch( FdoException *ex )
+ {
+ printf("FDO Feature query error: %ls\n", ex->GetExceptionMessage());
+ throw;
+ }
+ }
+}
+
+void FdoSelectTest::spatial_query_defect813611 ()
+{
+ FdoPtr<FdoIFeatureReader> myReader;
+ FdoPtr<FdoISelect> selCmd;
+
+ if( mConnection != NULL )
+ {
+ try
+ {
+ FdoInt32 size;
+ FdoInt32 idx;
+ bool found = false;
+ FdoPtr<FdoIFilterCapabilities> filterCapabilities = mConnection->GetFilterCapabilities();
+ FdoSpatialOperations *spatialOperations = filterCapabilities->GetSpatialOperations(size);
+
+ for ( idx = 0; idx < size; idx++ )
+ {
+ if ( spatialOperations[idx] == FdoSpatialOperations_Inside )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if ( found )
+ {
+ FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
+ selCmd = (FdoISelect*)mConnection->CreateCommand( FdoCommandType_Select );
+ selCmd->SetFeatureClassName(L"Acad:AcDb3dPolyline");
+
+ // We want a polygon with one circle formed by two arcs.
+
+ FdoString * geomText = L"CURVEPOLYGON XYZ ((1500876 500030 0 (CIRCULARARCSEGMENT (1400856 600050 0, 1300836 500030 0), CIRCULARARCSEGMENT (1400856 400010 0, 1500876 500030 0))))";
+ FdoPtr<FdoIGeometry> geom = gf->CreateGeometry(geomText);
+
+ FdoPtr<FdoGeometryValue> geomValue = FdoPtr<FdoGeometryValue>(FdoGeometryValue::Create(FdoPtr<FdoByteArray>(gf->GetFgf(geom))));
+ FdoPtr<FdoSpatialCondition> pSpatialFilter = FdoPtr<FdoSpatialCondition>(FdoSpatialCondition::Create(L"Geometry",
+ FdoSpatialOperations_Inside,
+ geomValue));
+
+ selCmd->SetFilter(pSpatialFilter);
+
+ FdoInt32 numFeatures = 0;
+
+ myReader = selCmd->Execute();
+ if( myReader != NULL )
+ {
+ while ( myReader->ReadNext() )
+ {
+ numFeatures++;
+ read_feature_data( myReader );
+ }
+ }
+ printf(" %i feature(s) read\n", numFeatures);
+ }
+ }
+ catch( FdoException *ex )
+ {
+ printf("FDO Feature query error: %ls\n", ex->GetExceptionMessage());
+ throw;
+ }
+ }
+}
+
+void FdoSelectTest::spatial_query_defect880310 ()
+{
+ FdoPtr<FdoIFeatureReader> myReader;
+ FdoPtr<FdoISelect> selCmd;
+
+ if( mConnection != NULL )
+ {
+ try
+ {
+ FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
+ selCmd = (FdoISelect*)mConnection->CreateCommand( FdoCommandType_Select );
+ selCmd->SetFeatureClassName(L"Acad:AcDb3dPolyline");
+
+ // Use multiple spatial filters (tests binding of multiple geometries).
+ selCmd->SetFilter(L"Geometry INTERSECTS geomfromtext('MULTILINESTRING XYZ ((10 48,10 21,10 0), (16 0,16 23,16 48))') "
+ L"or Geometry INTERSECTS geomfromtext('MULTILINESTRING XYZ ((10 48,10 21,10 0), (16 0,16 23,16 48))')");
+
+ FdoInt32 numFeatures = 0;
+
+ myReader = selCmd->Execute();
+ if( myReader != NULL )
+ {
+ while ( myReader->ReadNext() )
+ {
+ numFeatures++;
+ read_feature_data( myReader );
+ }
+ }
+ printf(" %i feature(s) read\n", numFeatures);
+ }
+ catch( FdoException *ex )
+ {
+ printf("FDO Feature query error: %ls\n", ex->GetExceptionMessage());
+ throw;
+ }
+ }
+}
+
void FdoSelectTest::feature_subset_query ()
{
FdoPtr<FdoIFeatureReader> myReader;
@@ -826,9 +1031,19 @@
if( ! myReader->IsNull(L"Geometry") )
{
+ int count1, count2;
+
+ const FdoByte* bytes = myReader->GetGeometry(L"Geometry", &count1);
+
FdoPtr<FdoByteArray> byteArray = myReader->GetGeometry(L"Geometry");
DBG( printf(" \t\tGemetry byte array size: %d\n", byteArray->GetCount()) );
- byteArray->GetCount();
+ count2 = byteArray->GetCount();
+ printf(" \t\tGeometry byte array size: %d\n", count2);
+ if ( count1 != count2 )
+ {
+ CPPUNIT_FAIL((const char*) FdoStringP::Format(L"FDO Feature query error: count1=%d vs. count2=%d\n", count1, count2));
+ throw;
+ }
}
DBG( printf("\n") );
}
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.h
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.h 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Common/FdoSelectTest.h 2007-03-20 16:02:21 UTC (rev 799)
@@ -30,10 +30,13 @@
CPPUNIT_TEST( feature_subset_query );
CPPUNIT_TEST( feature_query );
CPPUNIT_TEST( non_feature_query );
- // CPPUNIT_TEST( distance_query );
+ CPPUNIT_TEST( distance_query );
CPPUNIT_TEST( spatial_query );
- // CPPUNIT_TEST(feature_object_query);
-// CPPUNIT_TEST(feature_select_obj_distinct);
+ CPPUNIT_TEST( spatial_query_defect792377 );
+ CPPUNIT_TEST( spatial_query_defect813611 );
+ CPPUNIT_TEST( spatial_query_defect880310 );
+ CPPUNIT_TEST(feature_object_query);
+ CPPUNIT_TEST(feature_select_obj_distinct);
CPPUNIT_TEST(feature_geom_query);
CPPUNIT_TEST(concurrent_select);
CPPUNIT_TEST(_duplicateComputedIdTest);
@@ -52,6 +55,9 @@
virtual void non_feature_query ();
virtual void distance_query ();
virtual void spatial_query ();
+ virtual void spatial_query_defect792377();
+ virtual void spatial_query_defect813611();
+ virtual void spatial_query_defect880310();
virtual void feature_object_query();
virtual void feature_subset_query ();
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.h
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.h 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.h 2007-03-20 16:02:21 UTC (rev 799)
@@ -41,6 +41,9 @@
virtual void feature_subset_query2() {};
virtual void feature_select_obj_distinct() {};
virtual void feature_geom_query () {};
+ virtual void spatial_query_defect792377() {};
+ virtual void spatial_query_defect813611() {};
+ virtual void spatial_query_defect880310() {};
virtual FdoString * GetClassName() { return mSetup.LikesUC() ? L"TESTCLASS" : L"testClass"; };
Modified: branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/UnitTestMySql.vcproj
===================================================================
--- branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/UnitTestMySql.vcproj 2007-03-19 21:30:28 UTC (rev 798)
+++ branches/3.2.x/Providers/GenericRdbms/Src/UnitTest/UnitTestMySql.vcproj 2007-03-20 16:02:21 UTC (rev 799)
@@ -65,7 +65,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="cppunitd.lib FDO.lib FDOCommon.lib FDOGeometry.lib FdoGeneric.lib libmySQL.lib Rdbi.lib gdbi.lib schemamgrnew.lib MySQLDriver.lib mysqloverrides.lib mysqlschemamgr.lib ProvidersCommon.lib rdbmsoverrides.lib mysql.lib schemamgr_lpnew.lib schemamgr_phnew.lib SchemaMgr_OVNew.lib grdschemamgr.lib util.lib Advapi32.lib TestCommon.lib"
+ AdditionalDependencies="cppunitd.lib FDO.lib FDOCommon.lib FDOGeometry.lib FDOSpatial.lib FdoGeneric.lib libmySQL.lib Rdbi.lib gdbi.lib schemamgrnew.lib MySQLDriver.lib mysqloverrides.lib mysqlschemamgr.lib ProvidersCommon.lib rdbmsoverrides.lib mysql.lib schemamgr_lpnew.lib schemamgr_phnew.lib SchemaMgr_OVNew.lib grdschemamgr.lib util.lib Advapi32.lib TestCommon.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\Lib\Win32\Debug;$(FDO)\Unmanaged\Lib\Win32\Debug;"$(FDOUTILITIES)\Common\Lib\Win32\Debug";$(FDOTHIRDPARTY)\cppunit\lib;$(FDOMYSQL)\lib\Debug;$(FDOUTILITIES)\SchemaMgr\Lib\Win32\Debug;"$(FDOUTILITIES)\TestCommon\Lib\Win32\Debug""
IgnoreDefaultLibraryNames="libcmtd.lib"
@@ -145,7 +145,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="cppunit.lib FDO.lib FDOCommon.lib FDOGeometry.lib FdoGeneric.lib libmySQL.lib Rdbi.lib gdbi.lib schemamgrnew.lib MySQLDriver.lib mysqloverrides.lib mysqlschemamgr.lib ProvidersCommon.lib rdbmsoverrides.lib mysql.lib schemamgr_lpnew.lib schemamgr_phnew.lib SchemaMgr_OVNew.lib grdschemamgr.lib util.lib Advapi32.lib TestCommon.lib"
+ AdditionalDependencies="cppunit.lib FDO.lib FDOCommon.lib FDOGeometry.lib FDOSpatial.lib FdoGeneric.lib libmySQL.lib Rdbi.lib gdbi.lib schemamgrnew.lib MySQLDriver.lib mysqloverrides.lib mysqlschemamgr.lib ProvidersCommon.lib rdbmsoverrides.lib mysql.lib schemamgr_lpnew.lib schemamgr_phnew.lib SchemaMgr_OVNew.lib grdschemamgr.lib util.lib Advapi32.lib TestCommon.lib"
AdditionalLibraryDirectories="..\..\Lib\Win32\Release;$(FDO)\Unmanaged\Lib\Win32\Release;"$(FDOUTILITIES)\Common\Lib\Win32\Release";$(FDOTHIRDPARTY)\cppunit\lib;$(FDOMYSQL)\lib\opt;$(FDOUTILITIES)\SchemaMgr\Lib\Win32\Release;"$(FDOUTILITIES)\TestCommon\Lib\Win32\Release""
IgnoreDefaultLibraryNames="libc.lib"
/>
More information about the fdo-commits
mailing list