From fc33219f627af862696012e71ff2b973b6a1fbe8 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 20 Jul 2019 20:20:25 +0100 Subject: [PATCH] Correct TestEvent parsing to correctly recognise parse validity. Fuse test runner now runs! Signed-off-by: Adrian Conlon --- LR35902/LR35902.FuseTest/TestEvent.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/LR35902/LR35902.FuseTest/TestEvent.cs b/LR35902/LR35902.FuseTest/TestEvent.cs index 790ddec..3897a8d 100644 --- a/LR35902/LR35902.FuseTest/TestEvent.cs +++ b/LR35902/LR35902.FuseTest/TestEvent.cs @@ -5,9 +5,11 @@ public class TestEvent { + private int cycles; + public bool Valid { get; private set; } = false; - public int Cycles { get; private set; } = -1; + public int Cycles => this.cycles; public string Specifier { get; private set; } @@ -32,7 +34,12 @@ private void ParseLine(string[] tokens) { - this.Cycles = int.Parse(tokens[0]); + this.Valid = int.TryParse(tokens[0], out this.cycles); + if (!this.Valid) + { + return; + } + this.Specifier = tokens[1]; this.Valid = true;