Skip to content

Commit 50b6e20

Browse files
committed
Fixed compilation error in player build
1 parent 3a56ede commit 50b6e20

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Assets/_PackageRoot/Tests/Base/Utils/TestUtils.LoadFail.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ public static IEnumerator LoadFail(string url, FutureLoadingFrom? expectedLoadin
2828
futureListener.Assert_Events_Contains(expectedLoadingFrom.Value.ToEventName());
2929

3030
var task1 = future.AsTask();
31+
32+
// TODO: To find a way to use it a player build
33+
#if UNITY_EDITOR
3134
if (expectedLoadingFrom.HasValue && expectedLoadingFrom.Value == FutureLoadingFrom.Source) // exception should be thrown only if ONLY loading from Source
32-
LogAssert.Expect(LogType.Error, $"[ImageLoader] Future[id={future.Id}] Timeout ({timeout}): {url}");
35+
LogAssert.Expect(LogType.Error, $"[ImageLoader] Future[id={future.Id}] Timeout ({timeout}): {url}"); // compilation error in player build
36+
#endif
3337
yield return TestUtils.WaitWhile(() => future.IsInProgress, TimeSpan.FromSeconds(10));
3438
var task2 = future.AsTask();
3539

Assets/_PackageRoot/Tests/Base/Utils/TestUtils.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,21 @@ public static IEnumerator ClearEverything(string message)
3232
{
3333
if (message != null)
3434
Debug.Log(message.PadRight(50, '-'));
35-
LogAssert.ignoreFailingMessages = true;
35+
// TODO: To find a way to use it a player build
36+
#if UNITY_EDITOR
37+
LogAssert.ignoreFailingMessages = true; // compilation error in player build
38+
#endif
3639
UniTaskScheduler.UnobservedExceptionWriteLogType = LogType.Exception;
3740
ImageLoader.ClearSpriteRef();
3841
ImageLoader.ClearTextureRef();
3942
yield return ImageLoader.ClearCacheAll().TimeoutCoroutine(TimeSpan.FromSeconds(10));
4043

4144
WaitForGCFast();
42-
LogAssert.ignoreFailingMessages = false;
45+
46+
// TODO: To find a way to use it a player build
47+
#if UNITY_EDITOR
48+
LogAssert.ignoreFailingMessages = false; // compilation error in player build
49+
#endif
4350
}
4451
public static void WaitForGCFast()
4552
{

0 commit comments

Comments
 (0)