aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-21 20:09:19 +0000
committersaturneric <[email protected]>2024-11-21 20:09:19 +0000
commit4647c31d5f90b8de87c6577e098f605c8966dc4e (patch)
treebec61150ee6729d09587a2724f5575e3cc5dd7e8 /src/test
parentfeat: enhance cache api (diff)
downloadGpgFrontend-4647c31d5f90b8de87c6577e098f605c8966dc4e.tar.gz
GpgFrontend-4647c31d5f90b8de87c6577e098f605c8966dc4e.zip
fix: use sleep() provided by c++ standard
Diffstat (limited to 'src/test')
-rw-r--r--src/test/core/GpgCoreTestCache.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/core/GpgCoreTestCache.cpp b/src/test/core/GpgCoreTestCache.cpp
index 4d710944..696a766d 100644
--- a/src/test/core/GpgCoreTestCache.cpp
+++ b/src/test/core/GpgCoreTestCache.cpp
@@ -26,6 +26,9 @@
*
*/
+#include <chrono>
+#include <thread>
+
#include "GpgCoreTest.h"
#include "core/GpgConstants.h"
#include "core/function/CacheManager.h"
@@ -47,7 +50,7 @@ TEST_F(GpgCoreTest, CoreCacheTestB) {
TEST_F(GpgCoreTest, CoreCacheTestC) {
CacheManager::GetInstance().SaveCache("ABCDEF", "DEF", 2);
ASSERT_EQ(CacheManager::GetInstance().LoadCache("ABCDEF"), QString("DEFG"));
- sleep(4);
+ std::this_thread::sleep_for(std::chrono::milliseconds(4000));
ASSERT_EQ(CacheManager::GetInstance().LoadCache("ABCDEF"), QString(""));
}