[mapguide-commits] r9640 - in sandbox/jng/layer_bbox_toggle/Server/src: PostBuild UnitTesting
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Jan 29 04:47:54 PST 2020
Author: jng
Date: 2020-01-29 04:47:53 -0800 (Wed, 29 Jan 2020)
New Revision: 9640
Modified:
sandbox/jng/layer_bbox_toggle/Server/src/PostBuild/PostBuild.mak
sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.cpp
sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.h
Log:
Add unit test to verify the new inclusion flag is properly read and roundtrips through serialization.
Modified: sandbox/jng/layer_bbox_toggle/Server/src/PostBuild/PostBuild.mak
===================================================================
--- sandbox/jng/layer_bbox_toggle/Server/src/PostBuild/PostBuild.mak 2020-01-29 12:26:05 UTC (rev 9639)
+++ sandbox/jng/layer_bbox_toggle/Server/src/PostBuild/PostBuild.mak 2020-01-29 12:47:53 UTC (rev 9640)
@@ -234,6 +234,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -515,6 +516,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -796,6 +798,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -1077,6 +1080,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -1231,6 +1235,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -1380,6 +1385,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -1529,6 +1535,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -1676,6 +1683,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -1943,6 +1951,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -2217,6 +2226,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -2491,6 +2501,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -2765,6 +2776,7 @@
..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
..\..\bin\UnitTestFiles\MdfTestMap.mdf \
..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
+ ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf \
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
..\..\bin\UnitTestFiles\areasymbol.sd \
@@ -2912,6 +2924,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -3054,6 +3067,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -3196,6 +3210,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -3336,6 +3351,7 @@
if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
+ if EXIST ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf del /F ..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf
if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
if EXIST ..\..\bin\UnitTestFiles\areasymbol.sd del /F ..\..\bin\UnitTestFiles\areasymbol.sd
@@ -3451,6 +3467,7 @@
"..\..\..\UnitTest\TestData\KmlService\UT_GetFeaturesKmlResult.txt" :
"..\..\..\UnitTest\TestData\MdfModel\MdfTestMap.mdf" :
"..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf" :
+"..\..\..\UnitTest\TestData\MdfModel\MdfTestDisabledBounds.ldf" :
"..\..\..\UnitTest\TestData\MdfModel\MdfTestCompoundSymbol.sd" :
"..\..\..\UnitTest\TestData\MdfModel\MdfTestSimpleSymbol.sd" :
"..\..\..\UnitTest\TestData\Symbology\areasymbol.sd" :
@@ -3795,6 +3812,10 @@
if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
if EXIST "..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf" ..\..\bin\UnitTestFiles\
+..\..\bin\UnitTestFiles\MdfTestDisabledBounds.ldf : "..\..\..\UnitTest\TestData\MdfModel\MdfTestDisabledBounds.ldf"
+ if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
+ if EXIST "..\..\..\UnitTest\TestData\MdfModel\MdfTestDisabledBounds.ldf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MdfModel\MdfTestDisabledBounds.ldf" ..\..\bin\UnitTestFiles\
+
..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd : "..\..\..\UnitTest\TestData\MdfModel\MdfTestCompoundSymbol.sd"
if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
if EXIST "..\..\..\UnitTest\TestData\MdfModel\MdfTestCompoundSymbol.sd" xcopy /r /d /y "..\..\..\UnitTest\TestData\MdfModel\MdfTestCompoundSymbol.sd" ..\..\bin\UnitTestFiles\
Modified: sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.cpp
===================================================================
--- sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.cpp 2020-01-29 12:26:05 UTC (rev 9639)
+++ sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.cpp 2020-01-29 12:47:53 UTC (rev 9640)
@@ -78,6 +78,11 @@
Ptr<MgByteReader> ldfrdr3 = ldfsrc3->GetReader();
m_svcResource->SetResource(ldfres3, ldfrdr3, NULL);
+ Ptr<MgResourceIdentifier> ldfres4 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestDisabledBounds.LayerDefinition");
+ Ptr<MgByteSource> ldfsrc4 = new MgByteSource(L"../UnitTestFiles/MdfTestDisabledBounds.ldf", false);
+ Ptr<MgByteReader> ldfrdr4 = ldfsrc4->GetReader();
+ m_svcResource->SetResource(ldfres4, ldfrdr4, NULL);
+
Ptr<MgResourceIdentifier> mdfres4 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestMap.MapDefinition");
Ptr<MgByteSource> mdfsrc4 = new MgByteSource(L"../UnitTestFiles/MdfTestMap.mdf", false);
Ptr<MgByteReader> mdfrdr4 = mdfsrc4->GetReader();
@@ -122,6 +127,8 @@
m_svcResource->DeleteResource(sdres2);
Ptr<MgResourceIdentifier> ldfres3 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestTypeStyles.LayerDefinition");
m_svcResource->DeleteResource(ldfres3);
+ Ptr<MgResourceIdentifier> ldfres4 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestDisabledBounds.LayerDefinition");
+ m_svcResource->DeleteResource(ldfres4);
Ptr<MgResourceIdentifier> mdfres4 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestMap.MapDefinition");
m_svcResource->DeleteResource(mdfres4);
Ptr<MgResourceIdentifier> mdfres5 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestTileSet.TileSetDefinition");
@@ -186,7 +193,7 @@
CPPUNIT_ASSERT(parser.GetSucceeded());
// write the file - this exercises MdfParser serialization
- auto_ptr<SymbolDefinition> symbolDef1(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef1(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef1.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestSimpleSymbol_Copy1.sd", symbolDef1.get(), &symbolDefVersion);
@@ -198,7 +205,7 @@
Ptr<MgByteSink> sink1 = new MgByteSink(rdr1);
Ptr<MgByte> bytes1 = sink1->ToBuffer();
parser.ParseString((const char*)bytes1->Bytes(), bytes1->GetLength());
- auto_ptr<SymbolDefinition> symbolDef2(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef2(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef2.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestSimpleSymbol_Copy2.sd", symbolDef2.get(), &symbolDefVersion);
@@ -242,7 +249,7 @@
CPPUNIT_ASSERT(parser.GetSucceeded());
// write the file - this exercises MdfParser serialization
- auto_ptr<SymbolDefinition> symbolDef1(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef1(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef1.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestCompoundSymbol_Copy1.sd", symbolDef1.get(), &symbolDefVersion);
@@ -254,7 +261,7 @@
Ptr<MgByteSink> sink1 = new MgByteSink(rdr1);
Ptr<MgByte> bytes1 = sink1->ToBuffer();
parser.ParseString((const char*)bytes1->Bytes(), bytes1->GetLength());
- auto_ptr<SymbolDefinition> symbolDef2(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef2(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef2.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestCompoundSymbol_Copy2.sd", symbolDef2.get(), &symbolDefVersion);
@@ -307,7 +314,7 @@
CPPUNIT_ASSERT(parser.GetSucceeded());
// write the file - this exercises MdfParser serialization
- auto_ptr<VectorLayerDefinition> layerDef1(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef1(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef1.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_Copy1.ldf", NULL, layerDef1.get(), NULL, NULL, NULL, NULL, &layerDefVersion);
@@ -319,7 +326,7 @@
Ptr<MgByteSink> sink1 = new MgByteSink(rdr1);
Ptr<MgByte> bytes1 = sink1->ToBuffer();
parser.ParseString((const char*)bytes1->Bytes(), bytes1->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_Copy2.ldf", NULL, layerDef2.get(), NULL, NULL, NULL, NULL, &layerDefVersion);
@@ -370,7 +377,7 @@
CPPUNIT_ASSERT(parser.GetSucceeded());
// write the file - this exercises MdfParser serialization
- auto_ptr<MapDefinition> mapDef1(parser.DetachMapDefinition());
+ unique_ptr<MapDefinition> mapDef1(parser.DetachMapDefinition());
CPPUNIT_ASSERT(mapDef1.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestMap_Copy1.mdf", mapDef1.get(), NULL, NULL, NULL, NULL, NULL, &mapDefVersion);
@@ -382,7 +389,7 @@
Ptr<MgByteSink> sink1 = new MgByteSink(rdr1);
Ptr<MgByte> bytes1 = sink1->ToBuffer();
parser.ParseString((const char*)bytes1->Bytes(), bytes1->GetLength());
- auto_ptr<MapDefinition> mapDef2(parser.DetachMapDefinition());
+ unique_ptr<MapDefinition> mapDef2(parser.DetachMapDefinition());
CPPUNIT_ASSERT(mapDef2.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestMap_Copy2.mdf", mapDef2.get(), NULL, NULL, NULL, NULL, NULL, &mapDefVersion);
@@ -452,7 +459,7 @@
CPPUNIT_ASSERT(parser.GetSucceeded());
// write the file using each version - this exercises MdfParser serialization
- auto_ptr<SymbolDefinition> symbolDef1(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef1(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef1.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestCompoundSymbol_v10_Copy1.sd", symbolDef1.get(), &symbolDefVersion10);
@@ -470,7 +477,7 @@
Ptr<MgByteSink> sink1_10 = new MgByteSink(rdr1_10);
Ptr<MgByte> bytes1_10 = sink1_10->ToBuffer();
parser.ParseString((const char*)bytes1_10->Bytes(), bytes1_10->GetLength());
- auto_ptr<SymbolDefinition> symbolDef2_10(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef2_10(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef2_10.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestCompoundSymbol_v10_Copy2.sd", symbolDef2_10.get(), &symbolDefVersion10);
@@ -481,7 +488,7 @@
Ptr<MgByteSink> sink1_11 = new MgByteSink(rdr1_11);
Ptr<MgByte> bytes1_11 = sink1_11->ToBuffer();
parser.ParseString((const char*)bytes1_11->Bytes(), bytes1_11->GetLength());
- auto_ptr<SymbolDefinition> symbolDef2_11(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef2_11(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef2_11.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestCompoundSymbol_v11_Copy2.sd", symbolDef2_11.get(), &symbolDefVersion11);
@@ -492,7 +499,7 @@
Ptr<MgByteSink> sink1_24 = new MgByteSink(rdr1_24);
Ptr<MgByte> bytes1_24 = sink1_24->ToBuffer();
parser.ParseString((const char*)bytes1_24->Bytes(), bytes1_24->GetLength());
- auto_ptr<SymbolDefinition> symbolDef2_24(parser.DetachSymbolDefinition());
+ unique_ptr<SymbolDefinition> symbolDef2_24(parser.DetachSymbolDefinition());
CPPUNIT_ASSERT(symbolDef2_24.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestCompoundSymbol_v24_Copy2.sd", symbolDef2_24.get(), &symbolDefVersion24);
@@ -596,7 +603,7 @@
CPPUNIT_ASSERT(parser.GetSucceeded());
// write the file using each version - this exercises MdfParser serialization
- auto_ptr<VectorLayerDefinition> layerDef1(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef1(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef1.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v09_Copy1.ldf", NULL, layerDef1.get(), NULL, NULL, NULL, NULL, &layerDefVersion09);
@@ -626,7 +633,7 @@
Ptr<MgByteSink> sink1_09 = new MgByteSink(rdr1_09);
Ptr<MgByte> bytes1_09 = sink1_09->ToBuffer();
parser.ParseString((const char*)bytes1_09->Bytes(), bytes1_09->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_09(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_09(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_09.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v09_Copy2.ldf", NULL, layerDef2_09.get(), NULL, NULL, NULL, NULL, &layerDefVersion09);
@@ -637,7 +644,7 @@
Ptr<MgByteSink> sink1_10 = new MgByteSink(rdr1_10);
Ptr<MgByte> bytes1_10 = sink1_10->ToBuffer();
parser.ParseString((const char*)bytes1_10->Bytes(), bytes1_10->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_10(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_10(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_10.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v10_Copy2.ldf", NULL, layerDef2_10.get(), NULL, NULL, NULL, NULL, &layerDefVersion10);
@@ -648,7 +655,7 @@
Ptr<MgByteSink> sink1_11 = new MgByteSink(rdr1_11);
Ptr<MgByte> bytes1_11 = sink1_11->ToBuffer();
parser.ParseString((const char*)bytes1_11->Bytes(), bytes1_11->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_11(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_11(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_11.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v11_Copy2.ldf", NULL, layerDef2_11.get(), NULL, NULL, NULL, NULL, &layerDefVersion11);
@@ -659,7 +666,7 @@
Ptr<MgByteSink> sink1_12 = new MgByteSink(rdr1_12);
Ptr<MgByte> bytes1_12 = sink1_12->ToBuffer();
parser.ParseString((const char*)bytes1_12->Bytes(), bytes1_12->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_12(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_12(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_12.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v12_Copy2.ldf", NULL, layerDef2_12.get(), NULL, NULL, NULL, NULL, &layerDefVersion12);
@@ -670,7 +677,7 @@
Ptr<MgByteSink> sink1_13 = new MgByteSink(rdr1_13);
Ptr<MgByte> bytes1_13 = sink1_13->ToBuffer();
parser.ParseString((const char*)bytes1_13->Bytes(), bytes1_13->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_13(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_13(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_13.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy2.ldf", NULL, layerDef2_13.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
@@ -681,7 +688,7 @@
Ptr<MgByteSink> sink1_23 = new MgByteSink(rdr1_23);
Ptr<MgByte> bytes1_23 = sink1_23->ToBuffer();
parser.ParseString((const char*)bytes1_23->Bytes(), bytes1_23->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_23(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_23(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_23.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy2.ldf", NULL, layerDef2_23.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
@@ -692,7 +699,7 @@
Ptr<MgByteSink> sink1_24 = new MgByteSink(rdr1_24);
Ptr<MgByte> bytes1_24 = sink1_24->ToBuffer();
parser.ParseString((const char*)bytes1_24->Bytes(), bytes1_24->GetLength());
- auto_ptr<VectorLayerDefinition> layerDef2_24(parser.DetachVectorLayerDefinition());
+ unique_ptr<VectorLayerDefinition> layerDef2_24(parser.DetachVectorLayerDefinition());
CPPUNIT_ASSERT(layerDef2_24.get() != NULL);
parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v24_Copy2.ldf", NULL, layerDef2_24.get(), NULL, NULL, NULL, NULL, &layerDefVersion24);
@@ -1062,4 +1069,47 @@
SAFE_RELEASE(e);
CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
}
+}
+
+void TestMdfModel::TestCase_LayerDef_DisabledBounds()
+{
+ try
+ {
+ Ptr<MgResourceIdentifier> ldfId = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestDisabledBounds.LayerDefinition");
+ Ptr<MgByteReader> rdr = m_svcResource->GetResourceContent(ldfId);
+
+ MdfParser::SAX2Parser parser;
+
+ Ptr<MgByteSink> sink = new MgByteSink(rdr);
+ Ptr<MgByte> bytes = sink->ToBuffer();
+ CPPUNIT_ASSERT(bytes->GetLength() > 0);
+
+ parser.ParseString((const char*)bytes->Bytes(), bytes->GetLength());
+ CPPUNIT_ASSERT(parser.GetSucceeded());
+
+ unique_ptr<LayerDefinition> ldf(parser.DetachLayerDefinition());
+ CPPUNIT_ASSERT(ldf.get() != NULL);
+
+ VectorLayerDefinition* vl = dynamic_cast<VectorLayerDefinition*>(ldf.get());
+ CPPUNIT_ASSERT(vl != NULL);
+
+ CPPUNIT_ASSERT(!vl->GetIncludeBoundsForSelectedFeatures());
+
+ Ptr<MgLayer> layer = new MgLayer(ldfId, m_svcResource);
+ CPPUNIT_ASSERT(!layer->GetIncludeBoundsForSelectedFeatures());
+
+ Ptr<MgMemoryStreamHelper> helper = new MgMemoryStreamHelper();
+ Ptr<MgStream> stream = new MgStream(helper);
+ layer->Serialize(stream);
+
+ Ptr<MgLayer> layer2 = new MgLayer();
+ layer2->Deserialize(stream);
+ CPPUNIT_ASSERT(!layer2->GetIncludeBoundsForSelectedFeatures());
+ }
+ catch (MgException * e)
+ {
+ STRING message = e->GetDetails(TEST_LOCALE);
+ SAFE_RELEASE(e);
+ CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+ }
}
\ No newline at end of file
Modified: sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.h
===================================================================
--- sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.h 2020-01-29 12:26:05 UTC (rev 9639)
+++ sandbox/jng/layer_bbox_toggle/Server/src/UnitTesting/TestMdfModel.h 2020-01-29 12:47:53 UTC (rev 9640)
@@ -31,6 +31,8 @@
CPPUNIT_TEST(TestCase_TileSetDefinitionDefault);
CPPUNIT_TEST(TestCase_TileSetDefinitionXYZ);
+ CPPUNIT_TEST(TestCase_LayerDef_DisabledBounds);
+
CPPUNIT_TEST(TestEnd); // This must be the very last unit test
CPPUNIT_TEST_SUITE_END();
@@ -48,6 +50,8 @@
void TestCase_TileSetDefinitionDefault();
void TestCase_TileSetDefinitionXYZ();
+ void TestCase_LayerDef_DisabledBounds();
+
private:
Ptr<MgResourceService> m_svcResource;
};
More information about the mapguide-commits
mailing list