https://issues.shibboleth.net/jira/browse/CPPOST-66
[shibboleth/cpp-opensaml.git] / samltest / samltest.h
index a65544b..c996bde 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2005 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,9 @@
 #include <saml/SAMLConfig.h>
 #include <saml/binding/ArtifactMap.h>
 #include <xmltooling/util/ReplayCache.h>
+#include <xmltooling/util/TemplateEngine.h>
+
+using namespace opensaml;
 
 //#define SAML_LEAKCHECK
 
@@ -32,7 +35,10 @@ public:
         XMLToolingConfig::getConfig().log_config();
         if (!SAMLConfig::getConfig().init())
             return false;
+        if (!SAMLConfig::getConfig().init())    // should be a no-op
+            return false;
         XMLToolingConfig::getConfig().setReplayCache(new ReplayCache());
+        XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
         SAMLConfig::getConfig().setArtifactMap(new ArtifactMap());
 
         if (getenv("SAMLTEST_DATA"))
@@ -43,7 +49,9 @@ public:
         return true;
     }
     bool tearDownWorld() {
+        SAMLConfig::getConfig().term();     // should be a no-op
         SAMLConfig::getConfig().term();
+        SAMLConfig::getConfig().term();     // shouldn't cause a crash
 #if defined(_MSC_VER ) && defined(SAML_LEAKCHECK)
        _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
        _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );