From 0428189bedcc189c99df668617e23d133227bbb6 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Wed, 21 Apr 2021 10:11:19 -0500 Subject: [PATCH] Increase test difficulty --- .../AzCore/Tests/Asset/AssetManagerLoadingTests.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp b/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp index 34b6918400..9208294a32 100644 --- a/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp +++ b/Code/Framework/AzCore/Tests/Asset/AssetManagerLoadingTests.cpp @@ -594,13 +594,13 @@ namespace UnitTest DebugListener listener; auto assetUuids = { MyAsset1Id, - //MyAsset2Id, - //MyAsset3Id, + MyAsset2Id, + MyAsset3Id, }; AZStd::vector threads; AZStd::mutex mutex; - AZStd::atomic threadCount((int)assetUuids.size()); + AZStd::atomic threadCount(static_cast(assetUuids.size())); AZStd::condition_variable cv; AZStd::atomic_bool keepDispatching(true); @@ -618,10 +618,13 @@ namespace UnitTest threads.emplace_back([this, &threadCount, &cv, assetUuid]() { bool checkLoaded = true; - for (int i = 0; i < 1000; i++) + for (int i = 0; i < 5000; i++) { Asset asset1 = m_testAssetManager->GetAsset(assetUuid, azrtti_typeid(), AZ::Data::AssetLoadBehavior::PreLoad); + AZ::Debug::Trace::Output("", AZStd::string::format("Got ref from GetAsset: %s. Will block: %s\n", + asset1.GetId().ToString().c_str(), + checkLoaded ? "Yes" : "No").c_str()); if (checkLoaded) { @@ -633,7 +636,7 @@ namespace UnitTest checkLoaded = !checkLoaded; } - threadCount--; + --threadCount; cv.notify_one(); }); }