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

Method testSerialPortGetFileDescriptor

test/SerialPortUnitTests.cpp:712–732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712void
713SerialPortUnitTests::testSerialPortGetFileDescriptor()
714{
715 serialPort1.Open(TEST_SERIAL_PORT_1) ;
716 serialPort2.Open(TEST_SERIAL_PORT_2) ;
717
718 ASSERT_TRUE(serialPort1.IsOpen()) ;
719 ASSERT_TRUE(serialPort2.IsOpen()) ;
720
721 int fileDescriptor1 = serialPort1.GetFileDescriptor() ;
722 int fileDescriptor2 = serialPort2.GetFileDescriptor() ;
723
724 ASSERT_GT(fileDescriptor1, 0) ;
725 ASSERT_GT(fileDescriptor2, 0) ;
726
727 serialPort1.Close() ;
728 serialPort2.Close() ;
729
730 ASSERT_FALSE(serialPort1.IsOpen()) ;
731 ASSERT_FALSE(serialPort2.IsOpen()) ;
732}
733
734void
735SerialPortUnitTests::testSerialPortGetNumberOfBytesAvailable()

Callers

nothing calls this directly

Calls 4

OpenMethod · 0.45
IsOpenMethod · 0.45
GetFileDescriptorMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected