Skip to content

Commit

Permalink
misbehaving test
Browse files Browse the repository at this point in the history
  • Loading branch information
joekolodz committed Sep 28, 2021
1 parent fd746fa commit 54f942e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/HOTASQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,21 @@ public void button_pressed()

queue.ButtonPressed += (sender, e) => { isEventCalled = true; };
Assert.False(isEventCalled);

var sw = Stopwatch.StartNew();
var x = new long[80];

joystick.TestData[0] = new JoystickUpdate() { RawOffset = (int)JoystickOffset.Button1, Sequence = 0, Timestamp = 0, Value = (int)JoystickOffsetValues.ButtonState.ButtonPressed };
while (!isEventCalled && --timeOut > 0)
{
System.Threading.Thread.Sleep(10);
x[timeOut] = sw.ElapsedMilliseconds;
}
sw.Stop();

foreach (var i in x)
{
_output.WriteLine($"wait times: {i}");
}
Assert.True(isEventCalled);
}
Expand Down

0 comments on commit 54f942e

Please sign in to comment.