[mapguide-commits] r9751 - sandbox/jng/flatten_exceptions/Desktop/UnitTest
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Oct 22 09:15:50 PDT 2020
Author: jng
Date: 2020-10-22 09:15:50 -0700 (Thu, 22 Oct 2020)
New Revision: 9751
Modified:
sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestFeatureService.cpp
sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestLogManager.cpp
sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestResourceService.cpp
sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestTileService.cpp
Log:
Fix up mg-desktop unit test runner
Modified: sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestFeatureService.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestFeatureService.cpp 2020-10-22 15:52:00 UTC (rev 9750)
+++ sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestFeatureService.cpp 2020-10-22 16:15:50 UTC (rev 9751)
@@ -135,7 +135,7 @@
STRING provider = L"";
STRING property = L"";
STRING connectionString = L"";
- REQUIRE_THROWS_MG(pService->GetConnectionPropertyValues(provider, property, connectionString), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetConnectionPropertyValues(provider, property, connectionString), MgInvalidArgumentException);
provider = L"OSGeo.SDF";
property = L"ReadOnly";
@@ -186,7 +186,7 @@
provider = L"";
- REQUIRE_THROWS_MG(pService->GetCapabilities(provider), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetCapabilities(provider), MgInvalidArgumentException);
}
catch(MgException* e)
{
@@ -225,10 +225,10 @@
}
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
- REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
- REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
bool bResult = pService->TestConnection(resource);
@@ -271,10 +271,10 @@
}
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
- REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
- REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
Ptr<MgStringCollection> schemas = pService->GetSchemas(resource);
@@ -318,10 +318,10 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
STRING schemaName = L"";
- REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
- REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
schemaName = L"SHP_Schema";
@@ -367,27 +367,27 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
STRING schemaName = L"";
STRING className = L"";
- REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.MapDefinition");
schemaName = L"";
className = L"";
- REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
schemaName = L"SHP_Schema";
className = L"";
- REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgClassNotFoundException*);
+ REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgClassNotFoundException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
schemaName = L"Foo";
className = L"Bar";
- REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException*);
+ REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
schemaName = L"SHP_Schema";
className = L"Bar";
- REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException*);
+ REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
schemaName = L"SHP_Schema";
@@ -497,11 +497,11 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
STRING schemaName = L"";
- REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
schemaName = L"";
- REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
schemaName = L"";
@@ -886,13 +886,13 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
STRING className = L"";
Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
- REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.MapDefinition");
- REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
- REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
className = L"Parcels";
@@ -1064,13 +1064,13 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
STRING className = L"";
Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
- REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.MapDefinition");
- REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.FeatureSource");
- REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidArgumentException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.FeatureSource");
className = L"VotingDistricts";
@@ -1168,13 +1168,13 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
STRING className = L"";
Ptr<MgFeatureAggregateOptions> options = new MgFeatureAggregateOptions();
- REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.MapDefinition");
- REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
- REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidArgumentException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
className = L"Parcels";
@@ -1649,13 +1649,13 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
const STRING sqlQuery = L"";
- REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.MapDefinition");
- REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.FeatureSource");
- REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidArgumentException);
//TODO test with correct input
}
@@ -1698,13 +1698,13 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
const STRING sqlNonQuery = L"";
- REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.MapDefinition");
- REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.FeatureSource");
- REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidArgumentException);
//TODO test with correct input
}
@@ -1746,10 +1746,10 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
bool activeOnly = false;
- REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
- REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidResourceTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
@@ -1828,10 +1828,10 @@
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
bool activeOnly = false;
- REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
- REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidResourceTypeException);
//TODO test with correct input
}
@@ -1874,22 +1874,22 @@
STRING longTransactionName = L"Live";
// verify exception when passing in a nullptr resource
- REQUIRE_THROWS_MG(pService->SetLongTransaction(nullptr, longTransactionName), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->SetLongTransaction(nullptr, longTransactionName), MgNullArgumentException);
// verify exception when passing in an invalid resource type
Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
- REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidRepositoryTypeException*);
+ REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidRepositoryTypeException);
resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
- REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException);
// verify exception when session is not set
//resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
- //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException*);
+ //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException);
// set the user information for the current thread to be administrator - this
// alone doesn't create a session
- //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException*);
+ //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException);
// now set a session
//REQUIRE(pService->SetLongTransaction(resource, longTransactionName));
@@ -1936,7 +1936,7 @@
}
STRING readerId = L"0";
- REQUIRE_THROWS_MG(pService->GetFeatures(readerId), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetFeatures(readerId), MgInvalidArgumentException);
//TODO test with correct input
}
@@ -2017,7 +2017,7 @@
}
STRING sqlReader = L"0";
- REQUIRE_THROWS_MG(pService->GetSqlRows(sqlReader), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetSqlRows(sqlReader), MgInvalidArgumentException);
//TODO test with correct input
}
@@ -2101,7 +2101,7 @@
STRING featureReader = L"0";
INT32 xSize = 0;
INT32 ySize = 0;
- REQUIRE_THROWS_MG(pService->GetRaster(featureReader, xSize, ySize, L""), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetRaster(featureReader, xSize, ySize, L""), MgInvalidArgumentException);
//TODO test with correct input
}
@@ -2142,7 +2142,7 @@
}
STRING dataReader = L"0";
- REQUIRE_THROWS_MG(pService->GetDataRows(dataReader), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetDataRows(dataReader), MgInvalidArgumentException);
//TODO test with correct input
}
@@ -2614,7 +2614,7 @@
nameVal->SetValue(L"Bar");
//Execute again, expect MgFdoException due to constraint violation
- REQUIRE_THROWS_MG(result = pService->UpdateFeatures(featureSource, commands, true), MgFdoException*);
+ REQUIRE_THROWS_MG(result = pService->UpdateFeatures(featureSource, commands, true), MgFdoException);
//Expect one inserted result
Ptr<MgFeatureQueryOptions> query = new MgFeatureQueryOptions();
@@ -2938,10 +2938,7 @@
bool bResult = featSvc->TestConnection(fsId);
REQUIRE(false == bResult);
}
- catch (MgFdoException* ex)
- {
- SAFE_RELEASE(ex);
- }
+ MG_CATCH_AND_RELEASE_IF_TYPE(MgFdoException)
//Now apply credentials
resSvc->SetResourceCredentials(fsId, username, password);
@@ -2957,10 +2954,7 @@
bool bResult = featSvc->TestConnection(fsId);
REQUIRE(false == bResult);
}
- catch (MgFdoException* ex)
- {
- SAFE_RELEASE(ex);
- }
+ MG_CATCH_AND_RELEASE_IF_TYPE(MgFdoException)
//Try again without MG_USER_CREDENTIALS
resSvc->DeleteResourceData(fsId, MgResourceDataName::UserCredentials);
@@ -2970,10 +2964,7 @@
bool bResult = featSvc->TestConnection(fsId);
REQUIRE(false == bResult);
}
- catch (MgFdoException* ex)
- {
- SAFE_RELEASE(ex);
- }
+ MG_CATCH_AND_RELEASE_IF_TYPE(MgFdoException)
}
catch(MgException* e)
{
Modified: sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestLogManager.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestLogManager.cpp 2020-10-22 15:52:00 UTC (rev 9750)
+++ sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestLogManager.cpp 2020-10-22 16:15:50 UTC (rev 9751)
@@ -227,12 +227,12 @@
Ptr<MgStringProperty> newTestNameProp = new MgStringProperty(L"LogNameProperty", NewTestName);
REQUIRE(logs->Contains(newTestNameProp));
- REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"", NewTestName), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L""), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(TestName, TestName), MgDuplicateFileException*);
- REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"DoesNotExist.log", L"NewDoesNotExist.log"), MgFileNotFoundException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"", NewTestName), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L""), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(TestName, TestName), MgDuplicateFileException);
+ REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"DoesNotExist.log", L"NewDoesNotExist.log"), MgFileNotFoundException);
#ifdef _WIN32
- REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L"?"), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L"?"), MgInvalidArgumentException);
#endif
}
catch (MgException* e)
@@ -440,12 +440,12 @@
REQUIRE(logContents.length() == 0);
// Use a null value for the date
- REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(nullptr, toDate), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(nullptr, toDate), MgNullArgumentException);
// Use dates more than 24 hours apart
fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgInvalidArgumentException);
// Search a log file with an invalid log entry as the first entry
CreateFile(path + JunkName, L"asdfasdfasdf");
@@ -452,7 +452,7 @@
pMgdLogManager->SetAccessLogFileName(JunkName);
fromDate = new MgDateTime(2005, 3, 8, 0, 0, 0, 0);
toDate = new MgDateTime(2005, 3, 9, 0, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgdInvalidLogEntryException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgInvalidLogEntryException);
pMgdLogManager->SetAccessLogFileName(originalName);
}
@@ -479,7 +479,7 @@
TEST_CASE("GetAccessLogInvalid", "[LogManager]")
{
MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
- REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(-1), MgArgumentOutOfRangeException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(-1), MgArgumentOutOfRangeException);
}
///----------------------------------------------------------------------------
@@ -659,12 +659,12 @@
REQUIRE(logContents.length() == 0);
// Use a null value for the date
- REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(nullptr, toDate), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(nullptr, toDate), MgNullArgumentException);
// Use dates more than 24 hours apart
fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(fromDate, toDate), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(fromDate, toDate), MgInvalidArgumentException);
pMgdLogManager->SetAdminLogFileName(originalName);
}
@@ -691,7 +691,7 @@
TEST_CASE("GetAdminLogInvalid", "[LogManager]")
{
MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
- REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(-1), MgArgumentOutOfRangeException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(-1), MgArgumentOutOfRangeException);
}
///----------------------------------------------------------------------------
@@ -871,12 +871,12 @@
REQUIRE(logContents.length() == 0);
// Use a null value for the date
- REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(nullptr, toDate), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(nullptr, toDate), MgNullArgumentException);
// Use dates more than 24 hours apart
fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(fromDate, toDate), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(fromDate, toDate), MgInvalidArgumentException);
pMgdLogManager->SetAuthenticationLogFileName(originalName);
}
@@ -903,7 +903,7 @@
TEST_CASE("GetAuthenticationLogInvalid", "[LogManager]")
{
MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
- REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(-1), MgArgumentOutOfRangeException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(-1), MgArgumentOutOfRangeException);
}
///----------------------------------------------------------------------------
@@ -1083,12 +1083,12 @@
REQUIRE(logContents.length() == 0);
// Use a null value for the date
- REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(nullptr, toDate), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(nullptr, toDate), MgNullArgumentException);
// Use dates more than 24 hours apart
fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(fromDate, toDate), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(fromDate, toDate), MgInvalidArgumentException);
pMgdLogManager->SetErrorLogFileName(originalName);
}
@@ -1115,7 +1115,7 @@
TEST_CASE("GetErrorLogInvalid", "[LogManager]")
{
MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
- REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(-1), MgArgumentOutOfRangeException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(-1), MgArgumentOutOfRangeException);
}
///----------------------------------------------------------------------------
@@ -1295,12 +1295,12 @@
REQUIRE(logContents.length() == 0);
// Use a null value for the date
- REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(nullptr, toDate), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(nullptr, toDate), MgNullArgumentException);
// Use dates more than 24 hours apart
fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(fromDate, toDate), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(fromDate, toDate), MgInvalidArgumentException);
pMgdLogManager->SetSessionLogFileName(originalName);
}
@@ -1327,7 +1327,7 @@
TEST_CASE("GetSessionLogInvalid", "[LogManager]")
{
MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
- REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(-1), MgArgumentOutOfRangeException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(-1), MgArgumentOutOfRangeException);
}
///----------------------------------------------------------------------------
@@ -1507,12 +1507,12 @@
REQUIRE(logContents.length() == 0);
// Use a null value for the date
- REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(nullptr, toDate), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(nullptr, toDate), MgNullArgumentException);
// Use dates more than 24 hours apart
fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
- REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(fromDate, toDate), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(fromDate, toDate), MgInvalidArgumentException);
pMgdLogManager->SetTraceLogFileName(originalName);
}
@@ -1539,7 +1539,7 @@
TEST_CASE("GetTraceLogInvalid", "[LogManager]")
{
MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
- REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(-1), MgArgumentOutOfRangeException*);
+ REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(-1), MgArgumentOutOfRangeException);
}
///----------------------------------------------------------------------------
Modified: sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestResourceService.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestResourceService.cpp 2020-10-22 15:52:00 UTC (rev 9750)
+++ sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestResourceService.cpp 2020-10-22 16:15:50 UTC (rev 9751)
@@ -82,7 +82,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Library"), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Library"), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -108,7 +108,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->CreateRepository(nullptr, nullptr, nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->CreateRepository(nullptr, nullptr, nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -134,7 +134,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->UpdateRepository(nullptr, nullptr, nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->UpdateRepository(nullptr, nullptr, nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -160,7 +160,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->GetRepositoryContent(nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->GetRepositoryContent(nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -187,7 +187,7 @@
}
//Try to get repository header using a nullptr argument
- REQUIRE_THROWS_MG(pService->GetRepositoryHeader(nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->GetRepositoryHeader(nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -214,7 +214,7 @@
}
//Try using nullptr argument
- REQUIRE_THROWS_MG(pService->ApplyResourcePackage(nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->ApplyResourcePackage(nullptr), MgNullArgumentException);
//Not try the real thing
Ptr<MgByteSource> byteSource = new MgByteSource(packageName);
@@ -248,7 +248,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->DeleteRepository(nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->DeleteRepository(nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -279,7 +279,7 @@
// Try to check a nullptr resource.
bool existed = false;
- REQUIRE_THROWS_MG(service->ResourceExists(nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(service->ResourceExists(nullptr), MgNullArgumentException);
// Try to check a resource that exists
existed = service->ResourceExists(&libraryRepositoryIdentifier);
@@ -314,7 +314,7 @@
}
//Try to enumerate resources using a nullptr argument
- REQUIRE_THROWS_MG(pService->EnumerateResources(nullptr, -1, L"", true), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->EnumerateResources(nullptr, -1, L"", true), MgNullArgumentException);
// Enumerate the Library resource.
Ptr<MgByteReader> byteReader = pService->EnumerateResources(&libraryRepositoryIdentifier, -1, L"", true);
@@ -349,8 +349,8 @@
contentSource = nullptr;
//Try to use nullptr arguments
- REQUIRE_THROWS_MG(pService->SetResource(nullptr, nullptr, nullptr), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier, nullptr, nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->SetResource(nullptr, nullptr, nullptr), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier, nullptr, nullptr), MgNullArgumentException);
//Add a new resource
contentSource = new MgByteSource(resourceContentFileName);
@@ -421,20 +421,20 @@
//TODO: We can get xerces to vet the content as being XML, but can't figure out how to get xerces
//to validate the content model. Until we figure that out, the relevant assertions are commented
//out. Still at this stage it's better than letting any arbitrary content get through these calls.
- REQUIRE_THROWS_MG(pService->SetResource(resId, r1, nullptr), MgXmlParserException*);
- REQUIRE_THROWS_MG(pService->SetResource(resId, r2, nullptr), MgXmlParserException*);
- //REQUIRE_THROWS_MG(pService->SetResource(resId, r3, nullptr), MgXmlParserException*);
- REQUIRE_THROWS_MG(pService->SetResource(ldfId, r3, nullptr), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SetResource(resId, r1, nullptr), MgXmlParserException);
+ REQUIRE_THROWS_MG(pService->SetResource(resId, r2, nullptr), MgXmlParserException);
+ //REQUIRE_THROWS_MG(pService->SetResource(resId, r3, nullptr), MgXmlParserException);
+ REQUIRE_THROWS_MG(pService->SetResource(ldfId, r3, nullptr), MgInvalidResourceTypeException);
r3->Rewind();
- REQUIRE_THROWS_MG(pService->SetResource(mdfId, r3, nullptr), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SetResource(mdfId, r3, nullptr), MgInvalidResourceTypeException);
r3->Rewind();
- REQUIRE_THROWS_MG(pService->SetResource(pltId, r3, nullptr), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SetResource(pltId, r3, nullptr), MgInvalidResourceTypeException);
r3->Rewind();
- REQUIRE_THROWS_MG(pService->SetResource(symId, r3, nullptr), MgInvalidResourceTypeException*);
+ REQUIRE_THROWS_MG(pService->SetResource(symId, r3, nullptr), MgInvalidResourceTypeException);
r3->Rewind();
- REQUIRE_THROWS_MG(pService->SetResource(slbId, r3, nullptr), MgInvalidResourceTypeException*);
- REQUIRE_THROWS_MG(pService->SetResource(resId, r4, nullptr), MgInvalidResourceTypeException*);
- //REQUIRE_THROWS_MG(pService->SetResource(resId, r5, nullptr), MgXmlParserException*);
+ REQUIRE_THROWS_MG(pService->SetResource(slbId, r3, nullptr), MgInvalidResourceTypeException);
+ REQUIRE_THROWS_MG(pService->SetResource(resId, r4, nullptr), MgInvalidResourceTypeException);
+ //REQUIRE_THROWS_MG(pService->SetResource(resId, r5, nullptr), MgXmlParserException);
pService->SetResource(ssId, r6, nullptr);
pService->SetResource(csId, r7, nullptr);
}
@@ -464,12 +464,12 @@
}
//Try to use nullptr arguments
- REQUIRE_THROWS_MG(pService->MoveResource(nullptr, nullptr, true, false), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, nullptr, true, true), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pService->MoveResource(nullptr, &resourceIdentifier, true, false), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->MoveResource(nullptr, nullptr, true, false), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, nullptr, true, true), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pService->MoveResource(nullptr, &resourceIdentifier, true, false), MgNullArgumentException);
//Try to move a resource that doesn't exist
- REQUIRE_THROWS_MG(pService->MoveResource(&resourceNotExist, &resourceIdentifier2, false, true), MgResourceNotFoundException*);
+ REQUIRE_THROWS_MG(pService->MoveResource(&resourceNotExist, &resourceIdentifier2, false, true), MgResourceNotFoundException);
//Move the resource that was added earlier with cascade = true, and check referencing resource.
pService->MoveResource(&resourceIdentifier, &resourceIdentifier2, false, true);
@@ -488,7 +488,7 @@
REQUIRE(!pService->ResourceExists(&resourceIdentifier2));
//Try to move the resource into itself (ie. itself)
- REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier, false), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier, false), MgInvalidArgumentException);
}
catch(MgException* e)
{
@@ -516,18 +516,18 @@
}
//Try to use nullptr arguments
- REQUIRE_THROWS_MG(pService->CopyResource(nullptr, nullptr, true), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, nullptr, true), MgNullArgumentException*);
- REQUIRE_THROWS_MG(pService->CopyResource(nullptr, &resourceIdentifier2, true), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->CopyResource(nullptr, nullptr, true), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, nullptr, true), MgNullArgumentException);
+ REQUIRE_THROWS_MG(pService->CopyResource(nullptr, &resourceIdentifier2, true), MgNullArgumentException);
//Try to use source & destination as the same thing
- REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier2, false), MgInvalidArgumentException*);
+ REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier2, false), MgInvalidArgumentException);
//Copy the moved resource to another location
pService->CopyResource(&resourceIdentifier, &resourceIdentifier2, false);
//Try to copy a resource to one that should now exist
- REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier, false), MgDuplicateResourceException*);
+ REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier, false), MgDuplicateResourceException);
}
catch(MgException* e)
{
@@ -556,10 +556,10 @@
byteReader = nullptr;
//Try to get the content using nullptr arguments
- REQUIRE_THROWS_MG(pService->GetResourceContent(nullptr, L""), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetResourceContent(nullptr, L""), MgNullArgumentException);
//Try to get the content of a resource that doesn't exist
- REQUIRE_THROWS_MG(pService->GetResourceContent(&resourceNotExist, L""), MgResourceNotFoundException*);
+ REQUIRE_THROWS_MG(pService->GetResourceContent(&resourceNotExist, L""), MgResourceNotFoundException);
//Get the content of the resource that was added in TestCase_SetResource
byteReader = pService->GetResourceContent(&resourceIdentifier, L"");
@@ -591,13 +591,13 @@
}
//Try to get the contents using nullptr arguments
- REQUIRE_THROWS_MG(pService->GetResourceContents(nullptr, nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetResourceContents(nullptr, nullptr), MgNullArgumentException);
//Try to get the content of a resource that doesn't exist
Ptr<MgStringCollection> resourceNotExistCol = new MgStringCollection();
resourceNotExistCol->Add(resourceNotExist.ToString());
resourceNotExistCol->Add(resourceIdentifier.ToString());
- REQUIRE_THROWS_MG(pService->GetResourceContents(resourceNotExistCol, nullptr), MgResourceNotFoundException*);
+ REQUIRE_THROWS_MG(pService->GetResourceContents(resourceNotExistCol, nullptr), MgResourceNotFoundException);
//Get the content of the resource that was added in TestCase_SetResource
Ptr<MgStringCollection> resourceIds = new MgStringCollection();
@@ -634,7 +634,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->GetResourceHeader(nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->GetResourceHeader(nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -660,7 +660,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->EnumerateReferences(nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->EnumerateReferences(nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -686,7 +686,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->ChangeResourceOwner(nullptr, L"", false), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->ChangeResourceOwner(nullptr, L"", false), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -712,7 +712,7 @@
throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
}
- REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(nullptr), MgNotImplementedException*);
+ REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(nullptr), MgNotImplementedException);
}
catch(MgException* e)
{
@@ -743,10 +743,10 @@
byteReader = nullptr;
//Try enumerating using a nullptr argument
- REQUIRE_THROWS_MG(pService->EnumerateResourceData(nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->EnumerateResourceData(nullptr), MgNullArgumentException);
//Try enumerating using a resource that doesn't exist
- REQUIRE_THROWS_MG(pService->EnumerateResourceData(&resourceNotExist), MgResourceNotFoundException*);
+ REQUIRE_THROWS_MG(pService->EnumerateResourceData(&resourceNotExist), MgResourceNotFoundException);
//Enumerate the resource data of the resource added earlier
byteReader = pService->EnumerateResourceData(&resourceIdentifier);
@@ -781,12 +781,12 @@
dataSource = nullptr;
//Try using a nullptr identifier
- REQUIRE_THROWS_MG(pService->SetResourceData(nullptr, L"", L"", nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->SetResourceData(nullptr, L"", L"", nullptr), MgNullArgumentException);
//Try to name the resource data with a 0 character string
dataSource = new MgByteSource(dataFileName);
Ptr<MgByteReader> dataReader = dataSource->GetReader();
- REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, L"", L"File", dataReader), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, L"", L"File", dataReader), MgNullArgumentException);
//Set the resource data
dataSource = new MgByteSource(dataFileName);
@@ -818,16 +818,16 @@
}
//Try using a null argument for the idenfier
- REQUIRE_THROWS_MG(pService->RenameResourceData(nullptr, resourceDataName, resourceDataName2, true), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->RenameResourceData(nullptr, resourceDataName, resourceDataName2, true), MgNullArgumentException);
//Try using a resource identifier that doesn't exist
- REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceNotExist, resourceDataName, resourceDataName2, true), MgResourceNotFoundException*);
+ REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceNotExist, resourceDataName, resourceDataName2, true), MgResourceNotFoundException);
//Try to use a resource data name that doesn't exist
- REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, L"DoesNotExist", resourceDataName2, true), MgResourceDataNotFoundException*);
+ REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, L"DoesNotExist", resourceDataName2, true), MgResourceDataNotFoundException);
//Try to name the resource data with a 0 character string
- REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, L"", true), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, L"", true), MgNullArgumentException);
//Try to do a valid rename
pService->RenameResourceData(&resourceIdentifier, resourceDataName, resourceDataName2, false);
@@ -861,16 +861,16 @@
byteReader = nullptr;
//Try to get resource data using a nullptr identifier
- REQUIRE_THROWS_MG(pService->GetResourceData(nullptr, resourceDataName, L""), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetResourceData(nullptr, resourceDataName, L""), MgNullArgumentException);
//Try to get resource data using an empty data name string
- REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"", L""), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"", L""), MgNullArgumentException);
//Try to get the resource data of a resource that does not exist
- REQUIRE_THROWS_MG(pService->GetResourceData(&resourceNotExist, resourceDataName, L""), MgResourceNotFoundException*);
+ REQUIRE_THROWS_MG(pService->GetResourceData(&resourceNotExist, resourceDataName, L""), MgResourceNotFoundException);
//Try to get the resource data of a data name that doesn't exist
- REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"DoesNotExist", L""), MgResourceDataNotFoundException*);
+ REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"DoesNotExist", L""), MgResourceDataNotFoundException);
//Get resource data using valid arguments
byteReader = pService->GetResourceData(&resourceIdentifier, resourceDataName, L"");
@@ -900,13 +900,13 @@
}
//Try using a nullptr resource identifier
- REQUIRE_THROWS_MG(pService->DeleteResourceData(nullptr, resourceDataName), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->DeleteResourceData(nullptr, resourceDataName), MgNullArgumentException);
//Try using an empty string for the resource data name
- REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L""), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L""), MgNullArgumentException);
//Try deleting data that does not exist
- REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L"DoesNotExist"), MgResourceDataNotFoundException*);
+ REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L"DoesNotExist"), MgResourceDataNotFoundException);
//Delete the resource data that was set earlier
pService->DeleteResourceData(&resourceIdentifier, resourceDataName);
@@ -943,7 +943,7 @@
}
//Try to use a nullptr argument
- REQUIRE_THROWS_MG(pService->DeleteResource(nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(pService->DeleteResource(nullptr), MgNullArgumentException);
//Try to delete a resource that doesn't exist. We allow doing this for performance reason.
pService->DeleteResource(&resourceNotExist);
Modified: sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestTileService.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestTileService.cpp 2020-10-22 15:52:00 UTC (rev 9750)
+++ sandbox/jng/flatten_exceptions/Desktop/UnitTest/TestTileService.cpp 2020-10-22 16:15:50 UTC (rev 9751)
@@ -670,7 +670,7 @@
Ptr<MgdTileService> m_svcTile = dynamic_cast<MgdTileService*>(fact->CreateService(MgServiceType::TileService));
// call the API with a nullptr argument
- REQUIRE_THROWS_MG(m_svcTile->ClearCache(nullptr), MgNullArgumentException*);
+ REQUIRE_THROWS_MG(m_svcTile->ClearCache(nullptr), MgNullArgumentException);
// call the API with a map having a different name
Ptr<MgdMap> map = CreateMap(L"blah");
More information about the mapguide-commits
mailing list