[cpp-sp] branch main updated: Add initial Time ACL tests and adjust message comparisons.
Scott Cantor
cantor.2 at osu.edu
Mon Oct 27 16:47:45 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository cpp-sp.
View the commit online:
https://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=d0d865dc8dab5775c870dde5208daabf5c788fb7
The following commit(s) were added to refs/heads/main by this push:
new d0d865dc Add initial Time ACL tests and adjust message comparisons.
d0d865dc is described below
commit d0d865dc8dab5775c870dde5208daabf5c788fb7
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Oct 27 12:47:33 2025 -0400
Add initial Time ACL tests and adjust message comparisons.
---
tests/Makefile.am | 1 +
tests/data/impl/acl/time/acl-badxml.xml | 1 +
tests/data/impl/acl/time/external-acl-badxml.xml | 1 +
tests/data/impl/acl/time/internal-acl-invalid2.xml | 3 +++
tests/impl/XMLAccessControlTests.cpp | 8 +++++++-
tests/impl/XMLRequestMapperTests.cpp | 8 +++++++-
tests/platform/iis/ModuleConfigTests.cpp | 9 +++++++--
tests/session/impl/FilesystemSessionCacheTests.cpp | 8 +++++++-
tests/util/ReloadableXMLFileTests.cpp | 8 +++++++-
9 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 087c32d3..ae6ae700 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,7 @@ shibsptest_SOURCES = \
AgentTestSuite.cpp \
AgentConfigTests.cpp \
attribute/impl/DefaultAttributeConfigurationtests.cpp \
+ impl/TimeAccessControlTests.cpp \
impl/XMLAccessControlTests.cpp \
impl/XMLRequestMapperTests.cpp \
platform/iis/ModuleConfigTests.cpp \
diff --git a/tests/data/impl/acl/time/acl-badxml.xml b/tests/data/impl/acl/time/acl-badxml.xml
new file mode 100644
index 00000000..46663ff5
--- /dev/null
+++ b/tests/data/impl/acl/time/acl-badxml.xml
@@ -0,0 +1 @@
+<AccessControlProvider type="Time">
diff --git a/tests/data/impl/acl/time/external-acl-badxml.xml b/tests/data/impl/acl/time/external-acl-badxml.xml
new file mode 100644
index 00000000..e647978b
--- /dev/null
+++ b/tests/data/impl/acl/time/external-acl-badxml.xml
@@ -0,0 +1 @@
+<AccessControlProvider type="XML" path="./data/impl/acl/time/acl-badxml.xml" />
diff --git a/tests/data/impl/acl/time/internal-acl-invalid2.xml b/tests/data/impl/acl/time/internal-acl-invalid2.xml
new file mode 100644
index 00000000..cd1c2466
--- /dev/null
+++ b/tests/data/impl/acl/time/internal-acl-invalid2.xml
@@ -0,0 +1,3 @@
+<AccessControlProvider type="Time">
+ <Foo/>
+</AccessControlProvider>
diff --git a/tests/impl/XMLAccessControlTests.cpp b/tests/impl/XMLAccessControlTests.cpp
index be183714..2eb960a4 100644
--- a/tests/impl/XMLAccessControlTests.cpp
+++ b/tests/impl/XMLAccessControlTests.cpp
@@ -92,7 +92,13 @@ class exceptionCheck {
public:
exceptionCheck(const string& msg) : m_msg(msg) {}
bool check_message(const exception& e) {
- return m_msg.compare(e.what()) == 0;
+ if (m_msg.compare(e.what()) == 0) {
+ return true;
+ }
+ else {
+ cout << "Non-matching message: " << e.what() << endl;
+ return false;
+ }
}
private:
string m_msg;
diff --git a/tests/impl/XMLRequestMapperTests.cpp b/tests/impl/XMLRequestMapperTests.cpp
index 3640c362..9cc9acbd 100644
--- a/tests/impl/XMLRequestMapperTests.cpp
+++ b/tests/impl/XMLRequestMapperTests.cpp
@@ -85,7 +85,13 @@ class exceptionCheck {
public:
exceptionCheck(const string& msg) : m_msg(msg) {}
bool check_message(const exception& e) {
- return m_msg.compare(e.what()) == 0;
+ if (m_msg.compare(e.what()) == 0) {
+ return true;
+ }
+ else {
+ cout << "Non-matching message: " << e.what() << endl;
+ return false;
+ }
}
private:
string m_msg;
diff --git a/tests/platform/iis/ModuleConfigTests.cpp b/tests/platform/iis/ModuleConfigTests.cpp
index 367d37a9..cebb1270 100644
--- a/tests/platform/iis/ModuleConfigTests.cpp
+++ b/tests/platform/iis/ModuleConfigTests.cpp
@@ -43,8 +43,13 @@ class exceptionCheck {
public:
exceptionCheck(const string& msg) : m_msg(msg) {}
bool check_message(const exception& e) {
- cout << e.what() << endl;
- return m_msg.compare(e.what()) == 0;
+ if (m_msg.compare(e.what()) == 0) {
+ return true;
+ }
+ else {
+ cout << "Non-matching message: " << e.what() << endl;
+ return false;
+ }
}
private:
string m_msg;
diff --git a/tests/session/impl/FilesystemSessionCacheTests.cpp b/tests/session/impl/FilesystemSessionCacheTests.cpp
index 20be541c..c4bc56da 100644
--- a/tests/session/impl/FilesystemSessionCacheTests.cpp
+++ b/tests/session/impl/FilesystemSessionCacheTests.cpp
@@ -44,7 +44,13 @@ class exceptionCheck {
public:
exceptionCheck(const string& msg) : m_msg(msg) {}
bool check_message(const exception& e) {
- return m_msg.compare(e.what()) == 0;
+ if (m_msg.compare(e.what()) == 0) {
+ return true;
+ }
+ else {
+ cout << "Non-matching message: " << e.what() << endl;
+ return false;
+ }
}
private:
string m_msg;
diff --git a/tests/util/ReloadableXMLFileTests.cpp b/tests/util/ReloadableXMLFileTests.cpp
index c031d096..c1a8fc3e 100644
--- a/tests/util/ReloadableXMLFileTests.cpp
+++ b/tests/util/ReloadableXMLFileTests.cpp
@@ -109,7 +109,13 @@ class exceptionCheck {
public:
exceptionCheck(const string& msg) : m_msg(msg) {}
bool check_message(const exception& e) {
- return m_msg.compare(e.what()) == 0;
+ if (m_msg.compare(e.what()) == 0) {
+ return true;
+ }
+ else {
+ cout << "Non-matching message: " << e.what() << endl;
+ return false;
+ }
}
private:
string m_msg;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list