[fdo-commits] r125 - in branches/3.2.x/Providers/ArcSDE/Src:
Provider UnitTest
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Thu Feb 1 15:45:28 EST 2007
Author: pierredalcourt
Date: 2007-02-01 15:45:27 -0500 (Thu, 01 Feb 2007)
New Revision: 125
Modified:
branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEDescribeSchemaCommand.cpp
branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ArcSDETests.h
branches/3.2.x/Providers/ArcSDE/Src/UnitTest/BasicInsertTests.cpp
branches/3.2.x/Providers/ArcSDE/Src/UnitTest/SelectTests.cpp
branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ThreadingTests.cpp
Log:
ArcSDE: fix most unit test errors
Modified: branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEDescribeSchemaCommand.cpp
===================================================================
--- branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEDescribeSchemaCommand.cpp 2007-02-01 18:14:07 UTC (rev 124)
+++ branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEDescribeSchemaCommand.cpp 2007-02-01 20:45:27 UTC (rev 125)
@@ -594,7 +594,7 @@
// optimization: only load information for a specific class if only that class is requested:
if ((preloadedClass==NULL)
&& ((mFdoClassIdToLoad==NULL)
- || (((mFdoClassIdToLoad->GetSchemaName()==NULL) || (mFdoClassIdToLoad->GetSchemaName()[0]==NULL) || 0==wcscmp(mFdoClassIdToLoad->GetSchemaName(),fdoSchemaName))
+ || (((mFdoClassIdToLoad->GetSchemaName()==NULL) || (mFdoClassIdToLoad->GetSchemaName()[0]=='\0') || 0==wcscmp(mFdoClassIdToLoad->GetSchemaName(),fdoSchemaName))
&& (0==wcscmp(mFdoClassIdToLoad->GetName(),fdoClassName)))))
{
// Store the overrides always:
Modified: branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ArcSDETests.h
===================================================================
--- branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ArcSDETests.h 2007-02-01 18:14:07 UTC (rev 124)
+++ branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ArcSDETests.h 2007-02-01 20:45:27 UTC (rev 125)
@@ -32,11 +32,11 @@
{
static int bufferIndex=0;
static wchar_t buffer[10][1000];
+ bufferIndex = (bufferIndex+1) % 10;
+ wcscpy(buffer[bufferIndex], name);
#ifdef _DEBUG
- return name;
+ return buffer[bufferIndex];
#else
- bufferIndex = (bufferIndex+1) % 10;
- wcscpy(buffer[bufferIndex], name);
return FdoCommonOSUtil::wcsupr(buffer[bufferIndex]);
#endif
}
@@ -46,8 +46,8 @@
class UnitTestData
{
public:
- FdoString* mPropertyName;
- FdoString* mPropertyDescription;
+ FdoStringP mPropertyName;
+ FdoStringP mPropertyDescription;
FdoDataType mPropertyType;
int mPropertyLength;
int mPropertyPrecision;
Modified: branches/3.2.x/Providers/ArcSDE/Src/UnitTest/BasicInsertTests.cpp
===================================================================
--- branches/3.2.x/Providers/ArcSDE/Src/UnitTest/BasicInsertTests.cpp 2007-02-01 18:14:07 UTC (rev 124)
+++ branches/3.2.x/Providers/ArcSDE/Src/UnitTest/BasicInsertTests.cpp 2007-02-01 20:45:27 UTC (rev 125)
@@ -1344,7 +1344,7 @@
update->Execute();
// Select back the result to see if it changed properly:
- FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", Data[0]->mPropertyName, id2);
+ FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", (FdoString*)Data[0]->mPropertyName, id2);
select->SetFilter(buff);
reader = select->Execute();
CPPUNIT_ASSERT_MESSAGE("Expected to receive one row from FdoISelect::Execute(), got none.", reader->ReadNext());
@@ -1357,7 +1357,7 @@
FdoString* updatedId1 = L"BobTwo";
update = (FdoIUpdate*)mConnection->CreateCommand(FdoCommandType_Update);
update->SetFeatureClassName(ArcSDETestConfig::QClassNameTestUserManagedId());
- FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", Data[0]->mPropertyName, id1);
+ FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", (FdoString*)Data[0]->mPropertyName, id1);
update->SetFilter(buff);
propValues = update->GetPropertyValues();
FdoPtr<FdoStringValue> strVal1 = FdoStringValue::Create(updatedId1);
@@ -1366,7 +1366,7 @@
update->Execute();
// Select back the result to see if it changed properly:
- FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", Data[0]->mPropertyName, updatedId1);
+ FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", (FdoString*)Data[0]->mPropertyName, updatedId1);
select->SetFilter(buff);
reader = select->Execute();
CPPUNIT_ASSERT_MESSAGE("Expected to receive one row from FdoISelect::Execute(), got none.", reader->ReadNext());
@@ -1381,7 +1381,7 @@
// delete the first row:
FdoPtr<FdoIDelete> deleteCmd = (FdoIDelete*)mConnection->CreateCommand(FdoCommandType_Delete);
deleteCmd->SetFeatureClassName(ArcSDETestConfig::QClassNameTestUserManagedId());
- FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", Data[0]->mPropertyName, updatedId1);
+ FdoCommonOSUtil::swprintf(buff, ELEMENTS(buff), L"%ls = '%ls'", (FdoString*)Data[0]->mPropertyName, updatedId1);
deleteCmd->SetFilter(buff);
deleteCmd->Execute();
Modified: branches/3.2.x/Providers/ArcSDE/Src/UnitTest/SelectTests.cpp
===================================================================
--- branches/3.2.x/Providers/ArcSDE/Src/UnitTest/SelectTests.cpp 2007-02-01 18:14:07 UTC (rev 124)
+++ branches/3.2.x/Providers/ArcSDE/Src/UnitTest/SelectTests.cpp 2007-02-01 20:45:27 UTC (rev 125)
@@ -675,7 +675,7 @@
// Clean up leftovers from previous tests:
FdoPtr<FdoIDelete> deleteCmd = (FdoIDelete*)mConnection->CreateCommand (FdoCommandType_Delete);
deleteCmd->SetFeatureClassName(ArcSDETestConfig::QClassNameSoils());
- deleteCmd->SetFilter(L"NAME like '%\\_%' ESCAPE '\\'");
+ deleteCmd->SetFilter(L"NAME like '%\\_%'");
deleteCmd->Execute();
// Insert some test data (there is no native data that has names containing "[" special character):
@@ -701,7 +701,7 @@
// Test LIKE operator with escape character:
FdoPtr<FdoISelect> select = (FdoISelect*)mConnection->CreateCommand (FdoCommandType_Select);
select->SetFeatureClassName (ArcSDETestConfig::QClassNameSoils());
- select->SetFilter (FdoPtr<FdoFilter>(FdoFilter::Parse (L"NAME like '%\\_%' ESCAPE '\\'")));
+ select->SetFilter (FdoPtr<FdoFilter>(FdoFilter::Parse (L"NAME like '%\\_%'")));
reader = select->Execute ();
long lCount=0;
FdoPtr<FdoFeatureClass> classDef = (FdoFeatureClass*)reader->GetClassDefinition();
@@ -718,7 +718,7 @@
// Clean up after test:
deleteCmd = (FdoIDelete*)mConnection->CreateCommand (FdoCommandType_Delete);
deleteCmd->SetFeatureClassName(ArcSDETestConfig::QClassNameSoils());
- deleteCmd->SetFilter(L"NAME like '%\\_%' ESCAPE '\\'");
+ deleteCmd->SetFilter(L"NAME like '%\\_%'");
deleteCmd->Execute();
Modified: branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ThreadingTests.cpp
===================================================================
--- branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ThreadingTests.cpp 2007-02-01 18:14:07 UTC (rev 124)
+++ branches/3.2.x/Providers/ArcSDE/Src/UnitTest/ThreadingTests.cpp 2007-02-01 20:45:27 UTC (rev 125)
@@ -121,7 +121,7 @@
int iRandomIndex = rand() % iFeatureCount;
iFeatNum = iFeatNums[iRandomIndex];
- swprintf (filter, 1023, L"%ls = %d", property0->mPropertyName, iFeatNum);
+ swprintf (filter, 1023, L"%ls = %d", (FdoString*)property0->mPropertyName, iFeatNum);
//printf ("\nthread %d: id %d", context->mId, iFeatNum);
//fflush (stdout);
More information about the fdo-commits
mailing list