fix: use sleep() provided by c++ standard
This commit is contained in:
parent
4a60eadd27
commit
4647c31d5f
@ -26,6 +26,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
#include "GpgCoreTest.h"
|
#include "GpgCoreTest.h"
|
||||||
#include "core/GpgConstants.h"
|
#include "core/GpgConstants.h"
|
||||||
#include "core/function/CacheManager.h"
|
#include "core/function/CacheManager.h"
|
||||||
@ -47,7 +50,7 @@ TEST_F(GpgCoreTest, CoreCacheTestB) {
|
|||||||
TEST_F(GpgCoreTest, CoreCacheTestC) {
|
TEST_F(GpgCoreTest, CoreCacheTestC) {
|
||||||
CacheManager::GetInstance().SaveCache("ABCDEF", "DEF", 2);
|
CacheManager::GetInstance().SaveCache("ABCDEF", "DEF", 2);
|
||||||
ASSERT_EQ(CacheManager::GetInstance().LoadCache("ABCDEF"), QString("DEFG"));
|
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(""));
|
ASSERT_EQ(CacheManager::GetInstance().LoadCache("ABCDEF"), QString(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user