[cpp-sp] branch main updated: Windows does not support sleep()

Rod Widdowson rdw at steadingsoftware.com
Fri Jan 10 10:24:38 UTC 2025


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=1d039b5a493bfad4d70ccf4ce9bd0dc4195172f8

The following commit(s) were added to refs/heads/main by this push:
     new 1d039b5a Windows does not support sleep()
1d039b5a is described below

commit 1d039b5a493bfad4d70ccf4ce9bd0dc4195172f8
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Jan 9 17:10:40 2025 +0000

    Windows does not support sleep()
    
    We use Windows Sleep() instead
---
 tests/util/ReloadableXMLFileTests.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/util/ReloadableXMLFileTests.cpp b/tests/util/ReloadableXMLFileTests.cpp
index 8814317f..6e916a7a 100644
--- a/tests/util/ReloadableXMLFileTests.cpp
+++ b/tests/util/ReloadableXMLFileTests.cpp
@@ -25,6 +25,10 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/property_tree/xml_parser.hpp>
 
+#ifdef WIN32
+#include <Windows.h>
+#endif // WIN32
+
 using namespace shibsp;
 using namespace boost::property_tree;
 using namespace std;
@@ -163,7 +167,11 @@ BOOST_FIXTURE_TEST_CASE(ReloadableFileTest_inline_valid, ReloadableXMLFileFixtur
 
     // No-op since there's no locking internally.
     dummy.forceReload();
+#ifdef WIN32
+    Sleep(2);
+#else
     sleep(2);
+#endif // WIN32
 
     dummy.lock_shared();
     time_t ts2 = dummy.getLastModified();
@@ -183,7 +191,11 @@ BOOST_FIXTURE_TEST_CASE(ReloadableFileTest_external_valid, ReloadableXMLFileFixt
     dummy.unlock_shared();
 
     dummy.forceReload();
+#ifdef WIN32
+    Sleep(2);
+#else
     sleep(2);
+#endif // WIN32
 
     dummy.lock_shared();
     time_t ts2 = dummy.getLastModified();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list