Skip to content

Commit

Permalink
Merge pull request #145 from crayzeewulf/quiet_warnings
Browse files Browse the repository at this point in the history
Augment SerialPortUnitTest and SerialStreamUnitTest tests to quiet compiler warnings.
  • Loading branch information
crayzeewulf committed Jun 26, 2019
2 parents d37c365 + 59e3d33 commit c6d9da9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
11 changes: 4 additions & 7 deletions test/SerialPortUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,11 @@ SerialPortUnitTests::testSerialPortGetAvailableSerialPorts()
ASSERT_TRUE(serialPort1.IsOpen()) ;
ASSERT_TRUE(serialPort2.IsOpen()) ;

const auto serialPorts1 = serialPort1.GetAvailableSerialPorts() ;
const auto serialPorts2 = serialPort2.GetAvailableSerialPorts() ;
const auto portCount1 = serialPort1.GetAvailableSerialPorts() ;
const auto portCount2 = serialPort2.GetAvailableSerialPorts() ;

const auto portCount1 = serialPorts1.size() ;
const auto portCount2 = serialPorts2.size() ;

ASSERT_GE(portCount1, 2) ;
ASSERT_GE(portCount2, 2) ;
ASSERT_GE(portCount1.size(), 2UL) ;
ASSERT_GE(portCount2.size(), 2UL) ;
ASSERT_EQ(portCount1, portCount2) ;

serialPort1.Close() ;
Expand Down
17 changes: 4 additions & 13 deletions test/SerialStreamUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,20 +813,11 @@ SerialStreamUnitTests::testSerialStreamGetAvailableSerialPorts()
ASSERT_TRUE(serialStream1.IsOpen()) ;
ASSERT_TRUE(serialStream2.IsOpen()) ;

std::vector<std::string> serialPorts1;
std::vector<std::string> serialPorts2;
const auto portCount1 = serialStream1.GetAvailableSerialPorts() ;
const auto portCount2 = serialStream2.GetAvailableSerialPorts() ;

serialPorts1.clear() ;
serialPorts2.clear() ;

serialPorts1 = serialStream1.GetAvailableSerialPorts() ;
serialPorts2 = serialStream2.GetAvailableSerialPorts() ;

const auto portCount1 = serialPorts1.size() ;
const auto portCount2 = serialPorts2.size() ;

ASSERT_GE(portCount1, 2) ;
ASSERT_GE(portCount2, 2) ;
ASSERT_GE(portCount1.size(), 2UL) ;
ASSERT_GE(portCount2.size(), 2UL) ;
ASSERT_EQ(portCount1, portCount2) ;

serialStream1.Close() ;
Expand Down

0 comments on commit c6d9da9

Please sign in to comment.