ExecutionQueueTests.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #include "Wwise/WwiseUnitTests.h"
  16. #if WWISE_UNIT_TESTS
  17. #include "Wwise/WwiseExecutionQueue.h"
  18. #include <atomic>
  19. WWISE_TEST_CASE(Concurrency_ExecutionQueue_Smoke, "Wwise::Concurrency::ExecutionQueue_Smoke", "[ApplicationContextMask][SmokeFilter]")
  20. {
  21. SECTION("Static")
  22. {
  23. static_assert(std::is_constructible<FWwiseExecutionQueue, const TCHAR*>::value, "Can create a named Execution Queue");
  24. static_assert(std::is_constructible<FWwiseExecutionQueue, const TCHAR*, EWwiseTaskPriority>::value, "Can create a named Execution Queue with its own task priority");
  25. static_assert(!std::is_copy_constructible<FWwiseExecutionQueue>::value, "Cannot copy an Execution Queue");
  26. static_assert(!std::is_move_constructible<FWwiseExecutionQueue>::value, "Cannot move-construct an Execution Queue");
  27. static_assert(!std::is_copy_assignable<FWwiseExecutionQueue>::value, "Cannot assign an Execution Queue");
  28. static_assert(!std::is_move_assignable<FWwiseExecutionQueue>::value, "Cannot move-assign an Execution Queue");
  29. }
  30. SECTION("Instantiation")
  31. {
  32. FWwiseExecutionQueue NamedTask(WWISE_EQ_NAME("NamedTask Test"));
  33. FWwiseExecutionQueue PriorityTask(WWISE_EQ_NAME("PriorityTask Test"), EWwiseTaskPriority::Normal);
  34. }
  35. SECTION("Async At Destructor")
  36. {
  37. constexpr const int LoopCount = 10;
  38. std::atomic<int> Value{ 0 };
  39. {
  40. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  41. for (int i = 0; i < LoopCount; ++i)
  42. {
  43. ExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value]
  44. {
  45. ++Value;
  46. });
  47. }
  48. }
  49. CHECK(Value.load() == LoopCount);
  50. }
  51. SECTION("AsyncWait")
  52. {
  53. constexpr const int LoopCount = 10;
  54. std::atomic<int> Value{ 0 };
  55. {
  56. const auto CurrentThreadId = FPlatformTLS::GetCurrentThreadId();
  57. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  58. for (int i = 0; i < LoopCount; ++i)
  59. {
  60. ExecutionQueue.AsyncWait(WWISE_TEST_ASYNC_NAME, [&Value, CurrentThreadId]
  61. {
  62. CHECK_FALSE(CurrentThreadId == FPlatformTLS::GetCurrentThreadId());
  63. ++Value;
  64. });
  65. }
  66. CHECK(Value.load() == LoopCount);
  67. }
  68. }
  69. SECTION("Async in order")
  70. {
  71. constexpr const int LoopCount = 10;
  72. std::atomic<int> Value{ 0 };
  73. {
  74. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  75. for (int i = 0; i < LoopCount; ++i)
  76. {
  77. ExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value, ShouldBe = i]
  78. {
  79. CHECK(Value++ == ShouldBe);
  80. });
  81. }
  82. }
  83. CHECK(Value.load() == LoopCount);
  84. }
  85. SECTION("IsRunningInThisThread")
  86. {
  87. const auto CurrentThreadId = FPlatformTLS::GetCurrentThreadId();
  88. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  89. CHECK_FALSE(ExecutionQueue.IsRunningInThisThread());
  90. ExecutionQueue.AsyncWait(WWISE_TEST_ASYNC_NAME, [&ExecutionQueue, CurrentThreadId]
  91. {
  92. CHECK_FALSE(CurrentThreadId == FPlatformTLS::GetCurrentThreadId());
  93. CHECK(ExecutionQueue.IsRunningInThisThread());
  94. });
  95. CHECK_FALSE(ExecutionQueue.IsRunningInThisThread());
  96. }
  97. }
  98. WWISE_TEST_CASE(Concurrency_ExecutionQueue_Perf, "Wwise::Concurrency::ExecutionQueue_Perf", "[ApplicationContextMask][PerfFilter]")
  99. {
  100. SECTION("AsyncAddingOpPerf")
  101. {
  102. const bool bReduceLogVerbosity = FWwiseExecutionQueue::Test::bReduceLogVerbosity;
  103. FWwiseExecutionQueue::Test::bReduceLogVerbosity = true;
  104. ON_SCOPE_EXIT { FWwiseExecutionQueue::Test::bReduceLogVerbosity = bReduceLogVerbosity; };
  105. constexpr const int LoopCount = 500000;
  106. constexpr const int ExpectedUS = 600000;
  107. std::atomic<int> Value{ 0 };
  108. {
  109. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  110. FDateTime StartTime = FDateTime::UtcNow();
  111. for (int i = 0; i < LoopCount; ++i)
  112. {
  113. ExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value]
  114. {
  115. ++Value;
  116. });
  117. }
  118. FTimespan Duration = FDateTime::UtcNow() - StartTime;
  119. WWISE_TEST_LOG("AsyncAddingOpPerf %dus < %dus", (int)Duration.GetTotalMicroseconds(), ExpectedUS);
  120. CHECK(Duration.GetTotalMicroseconds() < ExpectedUS);
  121. }
  122. CHECK(Value.load() == LoopCount);
  123. }
  124. SECTION("AsyncExecutionPerf")
  125. {
  126. const bool bReduceLogVerbosity = FWwiseExecutionQueue::Test::bReduceLogVerbosity;
  127. FWwiseExecutionQueue::Test::bReduceLogVerbosity = true;
  128. ON_SCOPE_EXIT { FWwiseExecutionQueue::Test::bReduceLogVerbosity = bReduceLogVerbosity; };
  129. constexpr const int LoopCount = 250000;
  130. constexpr const int ExpectedUS = 400000;
  131. std::atomic<int> Value{ 0 };
  132. FDateTime StartTime;
  133. {
  134. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  135. ExecutionQueue.AsyncWait(WWISE_TEST_ASYNC_NAME, [&ExecutionQueue, LoopCount, &Value]
  136. {
  137. for (int i = 0; i < LoopCount; ++i)
  138. {
  139. ExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value]
  140. {
  141. ++Value;
  142. });
  143. }
  144. });
  145. StartTime = FDateTime::UtcNow();
  146. }
  147. FTimespan Duration = FDateTime::UtcNow() - StartTime;
  148. WWISE_TEST_LOG("AsyncExecutionPerf %dus < %dus", (int)Duration.GetTotalMicroseconds(), ExpectedUS);
  149. CHECK(Value.load() == LoopCount);
  150. CHECK(Duration.GetTotalMicroseconds() < ExpectedUS);
  151. }
  152. }
  153. WWISE_TEST_CASE(Concurrency_ExecutionQueue, "Wwise::Concurrency::ExecutionQueue", "[ApplicationContextMask][ProductFilter]")
  154. {
  155. SECTION("Close")
  156. {
  157. std::atomic<int> Value{ 0 };
  158. std::atomic<int> OpenedQueues{ 0 };
  159. constexpr const int RepeatLoop = 2;
  160. constexpr const int MainLoopCount = 2;
  161. constexpr const int SubLoopCount = 2;
  162. constexpr const int FinalLoopCount = 2;
  163. constexpr const int LoopCount = RepeatLoop * MainLoopCount * SubLoopCount * FinalLoopCount;
  164. for (int Repeat = 0; Repeat < RepeatLoop; ++Repeat)
  165. {
  166. FWwiseExecutionQueue MainExecutionQueue(WWISE_TEST_ASYNC_NAME);
  167. FWwiseExecutionQueue* SubExecutionQueue = new FWwiseExecutionQueue(WWISE_TEST_ASYNC_NAME);
  168. FWwiseExecutionQueue DeletionExecutionQueue(WWISE_TEST_ASYNC_NAME);
  169. for (int i = 0; i < MainLoopCount; ++i)
  170. {
  171. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value, &OpenedQueues, SubExecutionQueue, &DeletionExecutionQueue, SubLoopCount, FinalLoopCount]
  172. {
  173. for (int i = 0; i < SubLoopCount; ++i)
  174. {
  175. SubExecutionQueue->Async(WWISE_TEST_ASYNC_NAME, [&Value, &OpenedQueues, &DeletionExecutionQueue, FinalLoopCount]
  176. {
  177. ++OpenedQueues;
  178. auto ExecutionQueue = new FWwiseExecutionQueue(WWISE_TEST_ASYNC_NAME);
  179. for (int i = 0; i < FinalLoopCount; ++i)
  180. {
  181. ExecutionQueue->Async(WWISE_TEST_ASYNC_NAME, [&Value]
  182. {
  183. ++Value;
  184. });
  185. }
  186. DeletionExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&OpenedQueues, ExecutionQueue]
  187. {
  188. delete ExecutionQueue;
  189. --OpenedQueues;
  190. });
  191. });
  192. }
  193. });
  194. }
  195. MainExecutionQueue.Close();
  196. SubExecutionQueue->AsyncWait(WWISE_TEST_ASYNC_NAME, []{});
  197. SubExecutionQueue->CloseAndDelete();
  198. }
  199. CHECK(Value.load() == LoopCount);
  200. CHECK(OpenedQueues.load() == 0);
  201. }
  202. SECTION("Sleep on State Update")
  203. {
  204. const bool bMockSleepOnStateUpdate = FWwiseExecutionQueue::Test::bMockSleepOnStateUpdate;
  205. const bool bMockEngineDeletion = FWwiseExecutionQueue::Test::bMockEngineDeletion;
  206. FWwiseExecutionQueue::Test::bMockSleepOnStateUpdate = true;
  207. ON_SCOPE_EXIT
  208. {
  209. FWwiseExecutionQueue::Test::bMockSleepOnStateUpdate = bMockSleepOnStateUpdate;
  210. FWwiseExecutionQueue::Test::bMockEngineDeletion = bMockEngineDeletion;
  211. };
  212. std::atomic<int> Value{ 0 };
  213. constexpr const int RepeatLoop = 2;
  214. constexpr const int MainLoopCount = 2;
  215. constexpr const int SubLoopCount = 2;
  216. constexpr const int FinalLoopCount = 2;
  217. constexpr const int LoopCount = RepeatLoop * MainLoopCount * SubLoopCount * FinalLoopCount;
  218. for (int Repeat = 0; Repeat < RepeatLoop; ++Repeat)
  219. {
  220. FWwiseExecutionQueue MainExecutionQueue(WWISE_TEST_ASYNC_NAME);
  221. FWwiseExecutionQueue SubExecutionQueue(WWISE_TEST_ASYNC_NAME);
  222. FWwiseExecutionQueue DeletionExecutionQueue(WWISE_TEST_ASYNC_NAME);
  223. for (int i = 0; i < MainLoopCount; ++i)
  224. {
  225. if (i == MainLoopCount - 1)
  226. {
  227. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, []
  228. {
  229. FWwiseExecutionQueue::Test::bMockEngineDeletion = true;
  230. });
  231. }
  232. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value, &SubExecutionQueue, &DeletionExecutionQueue, SubLoopCount, FinalLoopCount]
  233. {
  234. for (int i = 0; i < SubLoopCount; ++i)
  235. {
  236. SubExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value, &DeletionExecutionQueue, FinalLoopCount]
  237. {
  238. auto ExecutionQueue = new FWwiseExecutionQueue(WWISE_TEST_ASYNC_NAME);
  239. for (int i = 0; i < FinalLoopCount; ++i)
  240. {
  241. ExecutionQueue->Async(WWISE_TEST_ASYNC_NAME, [&Value]
  242. {
  243. ++Value;
  244. });
  245. }
  246. DeletionExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [ExecutionQueue]
  247. {
  248. delete ExecutionQueue;
  249. });
  250. });
  251. }
  252. });
  253. }
  254. MainExecutionQueue.Close();
  255. SubExecutionQueue.Close();
  256. DeletionExecutionQueue.Close();
  257. FWwiseExecutionQueue::Test::bMockEngineDeletion = false;
  258. }
  259. CHECK(Value.load() == LoopCount);
  260. }
  261. SECTION("Async at exit")
  262. {
  263. const bool bMockEngineDeletion = FWwiseExecutionQueue::Test::bMockEngineDeletion;
  264. FWwiseExecutionQueue::Test::bMockEngineDeletion = true;
  265. ON_SCOPE_EXIT { FWwiseExecutionQueue::Test::bMockEngineDeletion = bMockEngineDeletion; };
  266. constexpr const int LoopCount = 10;
  267. std::atomic<int> Value{ 0 };
  268. {
  269. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  270. for (int i = 0; i < LoopCount; ++i)
  271. {
  272. ExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value, ShouldBe = i]
  273. {
  274. CHECK(Value++ == ShouldBe);
  275. });
  276. }
  277. }
  278. CHECK(Value.load() == LoopCount);
  279. }
  280. SECTION("Async after exit")
  281. {
  282. const bool bMockEngineDeleted = FWwiseExecutionQueue::Test::bMockEngineDeleted;
  283. FWwiseExecutionQueue::Test::bMockEngineDeleted = true;
  284. ON_SCOPE_EXIT { FWwiseExecutionQueue::Test::bMockEngineDeleted = bMockEngineDeleted; };
  285. constexpr const int LoopCount = 10;
  286. std::atomic<int> Value{ 0 };
  287. {
  288. const auto CurrentThreadId = FPlatformTLS::GetCurrentThreadId();
  289. FWwiseExecutionQueue::Test::bMockEngineDeleted = true;
  290. FWwiseExecutionQueue ExecutionQueue(WWISE_TEST_ASYNC_NAME);
  291. for (int i = 0; i < LoopCount; ++i)
  292. {
  293. ExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&Value, ShouldBe = i, CurrentThreadId]
  294. {
  295. CHECK(CurrentThreadId == FPlatformTLS::GetCurrentThreadId());
  296. CHECK(Value++ == ShouldBe);
  297. });
  298. }
  299. }
  300. CHECK(Value.load() == LoopCount);
  301. }
  302. }
  303. WWISE_TEST_CASE(Concurrency_ExecutionQueue_Stress, "Wwise::Concurrency::ExecutionQueue_Stress", "[ApplicationContextMask][StressFilter]")
  304. {
  305. SECTION("AsyncStress")
  306. {
  307. const bool bReduceLogVerbosity = FWwiseExecutionQueue::Test::bReduceLogVerbosity;
  308. FWwiseExecutionQueue::Test::bReduceLogVerbosity = !FWwiseExecutionQueue::Test::bExtremelyVerbose;
  309. ON_SCOPE_EXIT { FWwiseExecutionQueue::Test::bReduceLogVerbosity = bReduceLogVerbosity; };
  310. constexpr const int LoopCount = 2000000;
  311. constexpr const int MainLoopCount = 100;
  312. constexpr const int SubLoopCount = 100;
  313. constexpr const int FinalLoopCount = LoopCount / MainLoopCount / SubLoopCount;
  314. {
  315. FWwiseExecutionQueue MainExecutionQueue(WWISE_TEST_ASYNC_NAME);
  316. FWwiseExecutionQueue SubExecutionQueue(WWISE_TEST_ASYNC_NAME);
  317. FWwiseExecutionQueue DeletionExecutionQueue(WWISE_TEST_ASYNC_NAME);
  318. for (int i = 0; i < MainLoopCount; ++i)
  319. {
  320. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&SubExecutionQueue, &DeletionExecutionQueue, SubLoopCount, FinalLoopCount]
  321. {
  322. for (int i = 0; i < SubLoopCount; ++i)
  323. {
  324. SubExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&DeletionExecutionQueue, FinalLoopCount]
  325. {
  326. auto ExecutionQueue = new FWwiseExecutionQueue(WWISE_TEST_ASYNC_NAME);
  327. for (int i = 0; i < FinalLoopCount; ++i)
  328. {
  329. ExecutionQueue->Async(WWISE_TEST_ASYNC_NAME, []
  330. {
  331. });
  332. }
  333. DeletionExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [ExecutionQueue]
  334. {
  335. delete ExecutionQueue;
  336. });
  337. });
  338. }
  339. });
  340. }
  341. MainExecutionQueue.Close();
  342. SubExecutionQueue.Close();
  343. }
  344. }
  345. SECTION("AsyncStress with Sleep")
  346. {
  347. const bool bReduceLogVerbosity = FWwiseExecutionQueue::Test::bReduceLogVerbosity;
  348. const bool bMockSleepOnStateUpdate = FWwiseExecutionQueue::Test::bMockSleepOnStateUpdate;
  349. FWwiseExecutionQueue::Test::bReduceLogVerbosity = !FWwiseExecutionQueue::Test::bExtremelyVerbose;
  350. FWwiseExecutionQueue::Test::bMockSleepOnStateUpdate = true;
  351. ON_SCOPE_EXIT
  352. {
  353. FWwiseExecutionQueue::Test::bReduceLogVerbosity = bReduceLogVerbosity;
  354. FWwiseExecutionQueue::Test::bMockSleepOnStateUpdate = bMockSleepOnStateUpdate;
  355. };
  356. constexpr const int LoopCount = 1000;
  357. constexpr const int MainLoopCount = 10;
  358. constexpr const int SubLoopCount = 10;
  359. constexpr const int FinalLoopCount = LoopCount / MainLoopCount / SubLoopCount;
  360. {
  361. FWwiseExecutionQueue MainExecutionQueue(WWISE_TEST_ASYNC_NAME);
  362. FWwiseExecutionQueue SubExecutionQueue(WWISE_TEST_ASYNC_NAME);
  363. FWwiseExecutionQueue DeletionExecutionQueue(WWISE_TEST_ASYNC_NAME);
  364. for (int i = 0; i < MainLoopCount; ++i)
  365. {
  366. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&SubExecutionQueue, &DeletionExecutionQueue, SubLoopCount, FinalLoopCount]
  367. {
  368. for (int i = 0; i < SubLoopCount; ++i)
  369. {
  370. SubExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&DeletionExecutionQueue, FinalLoopCount]
  371. {
  372. auto ExecutionQueue = new FWwiseExecutionQueue(WWISE_TEST_ASYNC_NAME);
  373. for (int i = 0; i < FinalLoopCount; ++i)
  374. {
  375. ExecutionQueue->Async(WWISE_TEST_ASYNC_NAME, []
  376. {
  377. });
  378. }
  379. DeletionExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [ExecutionQueue]
  380. {
  381. delete ExecutionQueue;
  382. });
  383. });
  384. }
  385. });
  386. }
  387. MainExecutionQueue.Close();
  388. SubExecutionQueue.Close();
  389. }
  390. }
  391. SECTION("AsyncStress at Exit")
  392. {
  393. const bool bReduceLogVerbosity = FWwiseExecutionQueue::Test::bReduceLogVerbosity;
  394. const bool bMockEngineDeletion = FWwiseExecutionQueue::Test::bMockEngineDeletion;
  395. const bool bMockEngineDeleted = FWwiseExecutionQueue::Test::bMockEngineDeleted;
  396. FWwiseExecutionQueue::Test::bReduceLogVerbosity = !FWwiseExecutionQueue::Test::bExtremelyVerbose;
  397. ON_SCOPE_EXIT
  398. {
  399. FWwiseExecutionQueue::Test::bReduceLogVerbosity = bReduceLogVerbosity;
  400. FWwiseExecutionQueue::Test::bMockEngineDeletion = bMockEngineDeletion;
  401. FWwiseExecutionQueue::Test::bMockEngineDeleted = bMockEngineDeleted;
  402. };
  403. constexpr const int LoopCount = 100000;
  404. constexpr const int MainLoopCount = 100;
  405. constexpr const int SubLoopCount = 100;
  406. constexpr const int FinalLoopCount = LoopCount / MainLoopCount / SubLoopCount;
  407. {
  408. FWwiseExecutionQueue MainExecutionQueue(WWISE_TEST_ASYNC_NAME);
  409. FWwiseExecutionQueue SubExecutionQueue(WWISE_TEST_ASYNC_NAME);
  410. FWwiseExecutionQueue DeletionExecutionQueue(WWISE_TEST_ASYNC_NAME);
  411. for (int i = 0; i < MainLoopCount; ++i)
  412. {
  413. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&SubExecutionQueue, &DeletionExecutionQueue, SubLoopCount, FinalLoopCount]
  414. {
  415. for (int i = 0; i < SubLoopCount; ++i)
  416. {
  417. SubExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [&DeletionExecutionQueue, FinalLoopCount]
  418. {
  419. auto ExecutionQueue = new FWwiseExecutionQueue(WWISE_TEST_ASYNC_NAME);
  420. for (int i = 0; i < FinalLoopCount; ++i)
  421. {
  422. ExecutionQueue->Async(WWISE_TEST_ASYNC_NAME, []
  423. {
  424. });
  425. }
  426. DeletionExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, [ExecutionQueue]
  427. {
  428. delete ExecutionQueue;
  429. });
  430. });
  431. }
  432. });
  433. if (i == MainLoopCount / 3)
  434. {
  435. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, []
  436. {
  437. FWwiseExecutionQueue::Test::bMockEngineDeletion = true;
  438. });
  439. }
  440. }
  441. MainExecutionQueue.Async(WWISE_TEST_ASYNC_NAME, []
  442. {
  443. FWwiseExecutionQueue::Test::bMockEngineDeleted = true;
  444. });
  445. MainExecutionQueue.Close();
  446. SubExecutionQueue.Close();
  447. }
  448. }
  449. }
  450. #endif // WWISE_UNIT_TESTS