Skip to content

Commit c8dfb81

Browse files
committed
update tests
1 parent 35aad7d commit c8dfb81

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/encoder_test/encoder_test.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ test(requiredMemoryPerInstance)
4545
byte encoderNum = 0, pin1 = 2, pin2 = 3;
4646
int initialMemory = freeMemory();
4747
encoder.attachEncoder(encoderNum, pin1, pin2);
48-
49-
assertTrue((initialMemory - freeMemory()) < 1 );
48+
int afterInitializationMemory = freeMemory();
49+
int requiredMemory = initialMemory - afterInitializationMemory;
50+
Serial.print(requiredMemory, HEX);
51+
Serial.println(" mem req. per instance");
52+
assertTrue(requiredMemory < 100 );
5053
}
5154

5255
test(handleAttachEncoderMessage)
@@ -89,8 +92,8 @@ test(handlePinModes)
8992
{
9093
EncoderFirmata encoder;
9194

92-
assertTrue(encoder.handlePinMode(2, INPUT)); // 2 is interrupt
93-
assertFalse(encoder.handlePinMode(1, INPUT)); // 1 is NOT interrupt
95+
assertTrue(encoder.handlePinMode(2, ENCODER)); // 2 is interrupt
96+
assertFalse(encoder.handlePinMode(1, ENCODER)); // 1 is NOT interrupt
9497
}
9598

9699
test(reportEncoderPosition)

0 commit comments

Comments
 (0)