fix unit tests with thread waiting

This commit is contained in:
2019-03-26 20:44:03 +07:00
parent 9f37e1f780
commit 637de551ac

View File

@@ -75,13 +75,13 @@ TEST_CASE("library"){
REQUIRE(the<asset_cache<image_asset>>().find("image.png"));
REQUIRE(the<asset_cache<binary_asset>>().find("image.png"));
the<deferrer>().worker().wait_all();
std::this_thread::sleep_for(std::chrono::milliseconds(10));
the<asset_cache<binary_asset>>().unload_self_unused_assets();
REQUIRE(the<asset_cache<image_asset>>().find("image.png"));
REQUIRE_FALSE(the<asset_cache<binary_asset>>().find("image.png"));
image_res.reset();
the<deferrer>().worker().wait_all();
std::this_thread::sleep_for(std::chrono::milliseconds(10));
the<asset_cache<image_asset>>().unload_self_unused_assets();
REQUIRE_FALSE(the<asset_cache<image_asset>>().find("image.png"));
REQUIRE_FALSE(the<asset_cache<binary_asset>>().find("image.png"));