MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / unittest

Function unittest

libraries/DEVNULL/test/unit_test_001.cpp:40–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39
40unittest(test_all)
41{
42 DEVNULL dn;
43
44 assertEqual(0, dn.available());
45 assertEqual(EOF, dn.peek());
46 assertEqual(EOF, dn.read());
47
48 assertEqual(1, dn.write('a'));
49 assertEqual('a', dn.lastByte());
50
51 assertEqual(11, dn.print("hello world"));
52 assertEqual('d', dn.lastByte());
53 assertEqual(13, dn.println("hello world"));
54 assertEqual(10, dn.lastByte()); // 10 == newline
55}
56
57unittest_main()
58

Callers

nothing calls this directly

Calls 5

lastByteMethod · 0.80
availableMethod · 0.45
peekMethod · 0.45
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected