From aeabe4c749a462f17552f00f2c70563c51215ccd Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Thu, 2 Feb 2023 12:40:29 -0800 Subject: [PATCH 1/2] Add additional logging to Storage test asserts. --- .../Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs b/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs index 28970d010..236438c9e 100644 --- a/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs +++ b/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs @@ -207,6 +207,8 @@ protected override void Update() { // Throw when condition is false. private void Assert(string message, bool condition) { if (!condition) + DebugLog(String.Format("Assertion failed ({0}): {1}", + testRunner.CurrentTestDescription, message)); throw new Exception(String.Format("Assertion failed ({0}): {1}", testRunner.CurrentTestDescription, message)); } @@ -214,6 +216,9 @@ private void Assert(string message, bool condition) { // Throw when value1 != value2. private void AssertEq(string message, T value1, T value2) { if (!(object.Equals(value1, value2))) { + DebugLog(String.Format("Assertion failed ({0}): {1} != {2} ({3})", + testRunner.CurrentTestDescription, value1, value2, + message)); throw new Exception(String.Format("Assertion failed ({0}): {1} != {2} ({3})", testRunner.CurrentTestDescription, value1, value2, message)); From 31e0872401a698921ccb47af604b9064cf73e172 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Thu, 2 Feb 2023 13:01:28 -0800 Subject: [PATCH 2/2] Fix conditional --- .../Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs b/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs index 236438c9e..fef3e695b 100644 --- a/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs +++ b/storage/testapp/Assets/Firebase/Sample/Storage/UIHandlerAutomated.cs @@ -206,11 +206,12 @@ protected override void Update() { // Throw when condition is false. private void Assert(string message, bool condition) { - if (!condition) + if (!condition) { DebugLog(String.Format("Assertion failed ({0}): {1}", testRunner.CurrentTestDescription, message)); throw new Exception(String.Format("Assertion failed ({0}): {1}", testRunner.CurrentTestDescription, message)); + } } // Throw when value1 != value2.