Strict warnings in the unit tests. This commit needs to be carefully reviewed.

This commit is contained in:
Pavel Kirienko
2014-08-28 04:54:59 +04:00
parent d9d6e80aea
commit b09bfab117
27 changed files with 205 additions and 178 deletions
@@ -38,7 +38,7 @@ struct GlobalTimeSyncTestNetwork
void spinAll(uavcan::MonotonicDuration duration = uavcan::MonotonicDuration::fromMSec(9))
{
assert(!duration.isNegative());
unsigned nspins3 = duration.toMSec() / 3;
unsigned nspins3 = unsigned(duration.toMSec() / 3);
nspins3 = nspins3 ? nspins3 : 2;
while (nspins3 --> 0)
{
@@ -193,7 +193,7 @@ TEST(GlobalTimeSyncSlave, Validation)
slave_clock.preserve_utc = true;
CanDriverMock slave_can(3, slave_clock);
for (int i = 0; i < slave_can.getNumIfaces(); i++)
for (uint8_t i = 0; i < slave_can.getNumIfaces(); i++)
{
slave_can.ifaces.at(i).enable_utc_timestamping = true;
}
@@ -283,7 +283,7 @@ TEST(GlobalTimeSyncSlave, Suppression)
slave_clock.preserve_utc = true;
CanDriverMock slave_can(3, slave_clock);
for (int i = 0; i < slave_can.getNumIfaces(); i++)
for (uint8_t i = 0; i < slave_can.getNumIfaces(); i++)
{
slave_can.ifaces.at(i).enable_utc_timestamping = true;
}
@@ -32,7 +32,7 @@ static void publishNodeStatus(CanDriverMock& can, uavcan::NodeID node_id, uavcan
uavcan::CanFrame can_frame;
ASSERT_TRUE(frame.compile(can_frame));
for (int i = 0; i < can.getNumIfaces(); i++)
for (uint8_t i = 0; i < can.getNumIfaces(); i++)
{
can.ifaces.at(i).pushRx(can_frame);
}
+2 -2
View File
@@ -55,7 +55,7 @@ struct ParamServerTestManager : public uavcan::IParamManager
KeyValue::const_iterator it = kv.find(name.c_str());
if (it != kv.end())
{
out_value.value_float.push_back(it->second);
out_value.value_float.push_back(float(it->second));
}
std::cout << "READ [" << name.c_str() << "]\n" << out_value << "\n---" << std::endl;
}
@@ -146,7 +146,7 @@ TEST(ParamServer, Basic)
ASSERT_STREQ("foobar", get_set_cln.collector.result->response.name.c_str());
ASSERT_TRUE(get_set_cln.collector.result->response.value.value_bool.empty());
ASSERT_TRUE(get_set_cln.collector.result->response.value.value_int.empty());
ASSERT_FLOAT_EQ(123.456, get_set_cln.collector.result->response.value.value_float[0]);
ASSERT_FLOAT_EQ(123.456F, get_set_cln.collector.result->response.value.value_float[0]);
// Set by index
get_set_rq = uavcan::protocol::param::GetSet::Request();