You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider this quote:
I think the same can be said for libraries like pi4j. So I think this calls for a celebration! 🍾🍺🍻
Also I think the quote would've been funnier if the creator of JavaScript was the one associated with it haha
I would love a method like MockSpi.readEntireMockBuffer() that could be used during testing to get all the bytes that were written to the mock object by calls to write() or transfer() and weren't yet consumed by calls to read() or transfer().
THIS IS ISSUE #300! 🤩🥳🥳🥳🎂
Congrats pi4j people!
Consider this quote:
I think the same can be said for libraries like pi4j. So I think this calls for a celebration! 🍾🍺🍻
Also I think the quote would've been funnier if the creator of JavaScript was the one associated with it haha
...but anywho, I digress.
pi4j-v2/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/spi/MockSpi.java
Line 49 in 8d8f157
I would love a method like
MockSpi.readEntireMockBuffer()
that could be used during testing to get all the bytes that were written to the mock object by calls towrite()
ortransfer()
and weren't yet consumed by calls toread()
ortransfer()
.I tried to use a while loop and the
read()
method that returns -1 if the buffer is empty:https://github.com/Pi4J/pi4j-v2/blob/8d8f1574f926dfd2961356cf015dcbd58e50664e/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/spi/MockSpi.java#L145C1-L156C6
But I realised pretty quickly that this would cause a problem when the actual data was -1 (that's maybe also worth investigating).
In any case, It has been a pleasure to write Issue #300 for this awsm project!
Cheers
-MNG
The text was updated successfully, but these errors were encountered: