MCPcopy Create free account
hub / github.com/crayzeewulf/libserial / testSerialPortSetGetStopBits

Method testSerialPortSetGetStopBits

test/SerialPortUnitTests.cpp:466–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466void
467SerialPortUnitTests::testSerialPortSetGetStopBits()
468{
469 serialPort1.Open(TEST_SERIAL_PORT_1) ;
470 serialPort2.Open(TEST_SERIAL_PORT_2) ;
471
472 ASSERT_TRUE(serialPort1.IsOpen()) ;
473 ASSERT_TRUE(serialPort2.IsOpen()) ;
474
475 for (const auto stop_bits: stopBits)
476 {
477 serialPort1.SetStopBits(stop_bits) ;
478 serialPort2.SetStopBits(stop_bits) ;
479
480 const auto stopBits1 = serialPort1.GetStopBits() ;
481 const auto stopBits2 = serialPort2.GetStopBits() ;
482
483 ASSERT_EQ(stopBits1, stop_bits) ;
484 ASSERT_EQ(stopBits2, stop_bits) ;
485 }
486
487 serialPort1.Close() ;
488 serialPort2.Close() ;
489
490 ASSERT_FALSE(serialPort1.IsOpen()) ;
491 ASSERT_FALSE(serialPort2.IsOpen()) ;
492}
493
494void
495SerialPortUnitTests::testSerialPortSetGetVMin()

Callers

nothing calls this directly

Calls 5

OpenMethod · 0.45
IsOpenMethod · 0.45
SetStopBitsMethod · 0.45
GetStopBitsMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected