Skip to content

Commit

Permalink
Fix mock time
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCarlberg committed Nov 28, 2024
1 parent 67cc69d commit a727614
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions wpilibj/src/test/java/edu/wpi/first/wpilibj/LEDPatternTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ void relativeScrollingMask() {
var buffer = new AddressableLEDBuffer(8);

{
WPIUtilJNI.setMockTime(0); // start
m_mockTime = 0; // start
pattern.applyTo(buffer);
assertColorEquals(kRed, buffer.getLED(0));
assertColorEquals(kRed, buffer.getLED(1));
Expand All @@ -883,7 +883,7 @@ void relativeScrollingMask() {
}

{
WPIUtilJNI.setMockTime(1);
m_mockTime = 1;
pattern.applyTo(buffer);
assertColorEquals(kBlack, buffer.getLED(0));
assertColorEquals(kRed, buffer.getLED(1));
Expand All @@ -896,7 +896,7 @@ void relativeScrollingMask() {
}

{
WPIUtilJNI.setMockTime(2);
m_mockTime = 2;
pattern.applyTo(buffer);
assertColorEquals(kBlack, buffer.getLED(0));
assertColorEquals(kBlack, buffer.getLED(1));
Expand All @@ -909,7 +909,7 @@ void relativeScrollingMask() {
}

{
WPIUtilJNI.setMockTime(3);
m_mockTime = 3;
pattern.applyTo(buffer);
assertColorEquals(kBlack, buffer.getLED(0));
assertColorEquals(kBlack, buffer.getLED(1));
Expand All @@ -935,7 +935,7 @@ void absoluteScrollingMask() {
var buffer = new AddressableLEDBuffer(8);

{
WPIUtilJNI.setMockTime(0); // start
m_mockTime = 0; // start
pattern.applyTo(buffer);
assertColorEquals(kRed, buffer.getLED(0));
assertColorEquals(kRed, buffer.getLED(1));
Expand All @@ -948,7 +948,7 @@ void absoluteScrollingMask() {
}

{
WPIUtilJNI.setMockTime(1);
m_mockTime = 1;
pattern.applyTo(buffer);
assertColorEquals(kBlack, buffer.getLED(0));
assertColorEquals(kRed, buffer.getLED(1));
Expand All @@ -961,7 +961,7 @@ void absoluteScrollingMask() {
}

{
WPIUtilJNI.setMockTime(2);
m_mockTime = 2;
pattern.applyTo(buffer);
assertColorEquals(kBlack, buffer.getLED(0));
assertColorEquals(kBlack, buffer.getLED(1));
Expand All @@ -974,7 +974,7 @@ void absoluteScrollingMask() {
}

{
WPIUtilJNI.setMockTime(3);
m_mockTime = 3;
pattern.applyTo(buffer);
assertColorEquals(kBlack, buffer.getLED(0));
assertColorEquals(kBlack, buffer.getLED(1));
Expand Down

0 comments on commit a727614

Please sign in to comment.