[mapguide-commits] r9159 - sandbox/jng/clean_json/Server/src/UnitTesting
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Apr 19 10:13:03 PDT 2017
Author: jng
Date: 2017-04-19 10:13:03 -0700 (Wed, 19 Apr 2017)
New Revision: 9159
Modified:
sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.cpp
sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.h
Log:
Add a unit test for MG_API_VERSION macro to make sure it behaves how we are expecting
Modified: sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.cpp
===================================================================
--- sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.cpp 2017-04-19 16:35:53 UTC (rev 9158)
+++ sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.cpp 2017-04-19 17:13:03 UTC (rev 9159)
@@ -593,6 +593,26 @@
}
}
+void TestMisc::TestCase_ApiVersionCheck()
+{
+ try
+ {
+ //Just making sure this macro behaves as we expect
+ CPPUNIT_ASSERT_MESSAGE("Expected 3.4.0 >= 3.3.0", MG_API_VERSION(3, 4, 0) >= MG_API_VERSION(3, 3, 0));
+ CPPUNIT_ASSERT_MESSAGE("Expected 3.3.0 >= 3.3.0", MG_API_VERSION(3, 3, 0) >= MG_API_VERSION(3, 3, 0));
+ }
+ catch (MgException* e)
+ {
+ STRING message = e->GetDetails(TEST_LOCALE);
+ SAFE_RELEASE(e);
+ CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+ }
+ catch (...)
+ {
+ throw;
+ }
+}
+
void TestMisc::TestCase_MapLayerCollections()
{
try
Modified: sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.h
===================================================================
--- sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.h 2017-04-19 16:35:53 UTC (rev 9158)
+++ sandbox/jng/clean_json/Server/src/UnitTesting/TestMisc.h 2017-04-19 17:13:03 UTC (rev 9159)
@@ -30,6 +30,7 @@
CPPUNIT_TEST(TestCase_833);
CPPUNIT_TEST(TestCase_1304);
CPPUNIT_TEST(TestCase_MapLayerCollections);
+ CPPUNIT_TEST(TestCase_ApiVersionCheck);
CPPUNIT_TEST(TestEnd); // This must be the very last unit test
CPPUNIT_TEST_SUITE_END();
@@ -49,6 +50,7 @@
void TestCase_1304();
void TestCase_MapLayerCollections();
void TestCase_CreateMapWithInitialDisplayParams();
+ void TestCase_ApiVersionCheck();
private:
Ptr<MgSiteConnection> m_siteConnection;
More information about the mapguide-commits
mailing list