mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 07:43:34 +08:00
Strict warnings in the unit tests. This commit needs to be carefully reviewed.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user