[mapguide-commits] r7571 - trunk/MgDev/Server/src/UnitTesting
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jun 6 08:41:01 PDT 2013
Author: jng
Date: 2013-06-06 08:41:01 -0700 (Thu, 06 Jun 2013)
New Revision: 7571
Modified:
trunk/MgDev/Server/src/UnitTesting/TestMappingService.cpp
trunk/MgDev/Server/src/UnitTesting/TestMappingService.h
Log:
#2270: Trunk already has the fix, but not the test case. So merge that in.
Modified: trunk/MgDev/Server/src/UnitTesting/TestMappingService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestMappingService.cpp 2013-06-06 15:15:15 UTC (rev 7570)
+++ trunk/MgDev/Server/src/UnitTesting/TestMappingService.cpp 2013-06-06 15:41:01 UTC (rev 7571)
@@ -737,7 +737,39 @@
}
}
+void TestMappingService::TestCase_GetLegendImage()
+{
+ try
+ {
+ Ptr<MgResourceIdentifier> ldf = new MgResourceIdentifier(L"Library://UnitTests/Layers/Parcels.LayerDefinition");
+ Ptr<MgByteReader> rdr = m_svcMapping->GenerateLegendImage(ldf, 10000.0, 16, 16, MgImageFormats::Png, 3, 0);
+ Ptr<MgByteSink> sink = new MgByteSink(rdr);
+ sink->ToFile(L"../UnitTestFiles/GenerateLegendImage_Parcels_16x16_PNG.png");
+ rdr = m_svcMapping->GenerateLegendImage(ldf, 10000.0, 16, 16, MgImageFormats::Png8, 3, 0);
+ sink = new MgByteSink(rdr);
+ sink->ToFile(L"../UnitTestFiles/GenerateLegendImage_Parcels_16x16_PNG8.png");
+
+ rdr = m_svcMapping->GenerateLegendImage(ldf, 10000.0, 16, 16, MgImageFormats::Jpeg, 3, 0);
+ sink = new MgByteSink(rdr);
+ sink->ToFile(L"../UnitTestFiles/GenerateLegendImage_Parcels_16x16_JPG.jpg");
+
+ rdr = m_svcMapping->GenerateLegendImage(ldf, 10000.0, 16, 16, MgImageFormats::Gif, 3, 0);
+ sink = new MgByteSink(rdr);
+ sink->ToFile(L"../UnitTestFiles/GenerateLegendImage_Parcels_16x16_GIF.gif");
+ }
+ catch (MgException* e)
+ {
+ STRING message = e->GetDetails(TEST_LOCALE);
+ SAFE_RELEASE(e);
+ CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+ }
+ catch (...)
+ {
+ throw;
+ }
+}
+
void TestMappingService::TestCase_QueryFeaturesImageMap()
{
try
Modified: trunk/MgDev/Server/src/UnitTesting/TestMappingService.h
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestMappingService.h 2013-06-06 15:15:15 UTC (rev 7570)
+++ trunk/MgDev/Server/src/UnitTesting/TestMappingService.h 2013-06-06 15:41:01 UTC (rev 7571)
@@ -34,6 +34,7 @@
CPPUNIT_TEST(TestCase_GetPlotUsingExtents);
CPPUNIT_TEST(TestCase_GetPlotUsingExtentsAndExpandToFit);
CPPUNIT_TEST(TestCase_GetLegendPlot);
+ CPPUNIT_TEST(TestCase_GetLegendImage);
CPPUNIT_TEST(TestCase_CreateRuntimeMap);
//CPPUNIT_TEST(TestCase_QueryFeaturesImageMap);
@@ -61,6 +62,7 @@
void TestCase_GetPlotUsingExtents();
void TestCase_GetPlotUsingExtentsAndExpandToFit();
void TestCase_GetLegendPlot();
+ void TestCase_GetLegendImage();
void TestCase_QueryFeaturesImageMap();
private:
More information about the mapguide-commits
mailing list