Tests: areTimestampsClose() moved to common.hpp

This commit is contained in:
Pavel Kirienko
2014-03-09 17:58:17 +04:00
parent acca96f5a0
commit 5fa5962f6f
2 changed files with 11 additions and 12 deletions
+5
View File
@@ -90,3 +90,8 @@ static uavcan::CanFrame makeCanFrame(uint32_t id, const std::string& str_data, F
id |= (type == EXT) ? uavcan::CanFrame::FlagEFF : 0;
return uavcan::CanFrame(id, reinterpret_cast<const uint8_t*>(str_data.c_str()), str_data.length());
}
static bool areTimestampsClose(int64_t a, int64_t b, int64_t precision_usec = 10000)
{
return std::abs(a - b) < precision_usec;
}