Mocking serial device

Justin Whear via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 24 10:18:56 PDT 2014


On Thu, 24 Jul 2014 17:15:02 +0000, Alfredo Palhares wrote:

> Hello,
> 
> I am writing an application that connects to a serial device in
> /dev/ttyUSB0 and trows some binary data back and forth.
> 
> 
> How can i mock and run some unit testing without having to connect to
> the device every time?

How about capturing some data from the device and writing it to a file?  
When you want to test, open the test data file instead of the device file.


More information about the Digitalmars-d-learn mailing list