Commit 17961ed1 authored by Pavel Vainerman's avatar Pavel Vainerman

Очередные исправления по результатам проверки Coverity

parent f7e16de5
......@@ -270,7 +270,7 @@ void MBExchange::waitSMReady()
// waiting for SM is ready...
int tout = uniset_conf()->getArgInt("--" + prefix + "-sm-ready-timeout", "15000");
timeout_t ready_timeout = 15000;
if( ready_timeout > 0 )
if( tout > 0 )
ready_timeout = tout;
else if( tout < 0 )
ready_timeout = UniSetTimer::WaitUpTime;
......
......@@ -463,7 +463,7 @@ void MBSlave::waitSMReady()
// waiting for SM is ready...
int tout = uniset_conf()->getArgInt("--" + prefix + "-sm-ready-timeout", "15000");
timeout_t ready_timeout = 15000;
if( ready_timeout > 0 )
if( tout > 0 )
ready_timeout = tout;
else if( tout < 0 )
ready_timeout = UniSetTimer::WaitUpTime;
......
......@@ -165,7 +165,7 @@ TEST_CASE("[UNetUDP]: UDPMessage", "[unetudp][udpmessage]")
size_t len = u.transport_msg(p);
CHECK( len != 0 );
REQUIRE( a < UniSetUDP::MaxACount );
REQUIRE( a < UniSetUDP::MaxDCount );
REQUIRE( d < UniSetUDP::MaxDCount );
UniSetUDP::UDPMessage u2(p);
REQUIRE( u2.a_dat[a].id == 100 );
......
......@@ -56,14 +56,6 @@ static bool split_addr( const string& addr, string& host, ost::tpport_t& port )
// --------------------------------------------------------------------------
int main(int argc, char* argv[])
{
size_t n = UniSetUDP::MaxPacketNum;
cout << "n=" << n << endl;
n++;
cout << "n++=" << n << endl;
return 0;
int optindex = 0;
int opt = 0;
Command cmd = cmdNOP;
......@@ -332,7 +324,9 @@ int main(int argc, char* argv[])
{
mypack.num = packetnum++;
if( packetnum > UniSetUDP::MaxPacketNum )
// при переходе черех максимум (UniSetUDP::MaxPacketNum)
// пакет опять должен иметь номер "1"
if( packetnum == 0 )
packetnum = 1;
try
......
......@@ -19,9 +19,9 @@ int main( int argc, char* argv[] )
return session.run();
}
catch( UniSetTypes::Exception& ex )
catch( const std::exception& ex )
{
std::cerr << ex << std::endl;
std::cerr << ex.what() << std::endl;
}
return 1;
......
......@@ -113,7 +113,7 @@ TEST_CASE("UniXML::iterator", "[unixml][iterator][basic]" )
REQUIRE( sIt.getProp("name") == "Test5" );
it = uxml.begin();
it.goChildren();
REQUIRE( it.goChildren() == true );
CHECK( it.getName() == "UserData" );
it.goParent();
CHECK( it.getName() == "UNISETPLC" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment