[Test] public void Indexer1([Values(true, false)] bool lg) { status.log = lg; var s = (done() && cont())[log && "Floppy"]; o(StatusFormat.Status(s), lg ? $"+ {T}.Indexer1 (Floppy)" : "+ ?trace"); }
public TestBase() { StatusFormat.UseASCII(); // TODO - since all decorators require an RoR context, // unit tests break down when RoR is enabled. This should be // relatively safe. Alternatively consider managing the // context on setup/teardown RoR.enabled = false; }
[Test] public void NestedLogs() { var x = new Deco(_done: "+Out", _fail: "-Out"); var y = new Deco(_done: "+In", _fail: "-In"); bool z = false; var s = x[true]?[y[true]?[z = true]]; o(z, true); o(StatusFormat.Status(s), "* <D> +Out -> <D> +In -> StatusDetails.op_Implicit"); }
/// <summary> /// Constructor. /// </summary> /// <param name="psem">The current PSEM communications object.</param> /// <param name="bytSize"></param> /// <param name="enumStatusFormat"></param> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 02/05/10 jrf 2.40.12 Created // public OpenWayMFGTable2180(CPSEM psem, StatusFormat enumStatusFormat, byte bytSize) : base(psem, 2180, GetTableSize(enumStatusFormat, bytSize)) { //MissingBlocks if (StatusFormat.MissingBlocks == enumStatusFormat) { m_ausBlocksMissing = new ushort[bytSize]; } //Bitfield else if (StatusFormat.MissingBlocks == enumStatusFormat) { m_abytBlocksMissing = new byte[bytSize]; } }
/// <summary> /// Determines the size of the table /// </summary> /// <returns>The size of the table in bytes</returns> // Revision History // MM/DD/YY Who Version Issue# Description // -------- --- ------- ------ ------------------------------------------- // 02/05/10 jrf 2.40.12 Created // private static ushort GetTableSize(StatusFormat enumStatusFormat, byte bytSize) { ushort usTableSize = 5; if (StatusFormat.MissingBlocks == enumStatusFormat) { usTableSize += (ushort)(1 + 2 * bytSize); } else if (StatusFormat.Bitfield == enumStatusFormat) { usTableSize += (ushort)(4 + bytSize); } return(usTableSize); }
void Log(status s) { #if !AL_OPTIMIZE var previousLog = log; log = StatusFormat.CallTree(s); Logger.RequestPaint(); if (step && History.TrimLog(log) != History.TrimLog(previousLog)) { Debug.LogError($"Step {gameObject.name}"); } if (useHistory) { history.Log(log, transform); } if (!step && useBreakpoints && breaksFound) { Debug.LogError($"Break in {gameObject.name}"); } #endif }
override public string ToString() => StatusFormat.Decorator(this);
void Setup() { StatusFormat.UseASCII(); status.log = false; }
[SetUp] virtual public void Setup() { x = new T(); StatusFormat.UseASCII(); status.log = true; }
[Test] public void Format() => o(StatusFormat.Status(x[1f]), "+ <U> undef");
[Test] public void RedundantTrace() { var s = Eval(done()); o(StatusFormat.Status(s).Substring(2), $"{T}.RedundantTrace"); }
[Test] public void Indexer2() { var s = Nested()[log && "Floppy"]; o(StatusFormat.Status(s), $"+ {T}.Nested (Floppy)"); }
[Test] public void Indexer1() { var s = (done() && cont())[log && "Floppy"]; o(StatusFormat.Status(s), $"+ {T}.Indexer1 (Floppy)"); }
[SetUp] public void Setup() => StatusFormat.UseASCII();
[SetUp] public void Setup() { _log = status.log; StatusFormat.UseASCII(); }