Skip to content

Commit 3d989f4

Browse files
committed
more documentation on pin history
1 parent d05cdca commit 3d989f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

REFERENCE.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,16 @@ unittest(pin_history)
174174
digitalWrite(myPin, HIGH);
175175
176176
// pin history is queued in case we want to analyze it later.
177-
// we expect 6 values in that queue.
177+
// we expect 6 values in that queue (5 that we set plus one
178+
// initial value), which we'll hard-code here for convenience.
179+
// (we'll actually assert those 6 values in the next block)
178180
assertEqual(6, state->digitalPin[1].size());
179181
bool expected[6] = {LOW, HIGH, LOW, LOW, HIGH, HIGH};
180182
bool actual[6];
181183
182-
// convert history queue into an array so we can verify it
184+
// convert history queue into an array so we can verify it.
185+
// while we're at it, check that we received the amount of
186+
// elements that we expected.
183187
int numMoved = state->digitalPin[myPin].toArray(actual, 6);
184188
assertEqual(6, numMoved);
185189

0 commit comments

Comments
 (0)