mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-21 19:33:18 +08:00
POSIX: ported systemcmds/tests
Most of the systemcmds tests run in the posix build. The UART tests fail for me as I do not have a UART connected. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -59,20 +59,20 @@
|
||||
|
||||
int test_conv(int argc, char *argv[])
|
||||
{
|
||||
warnx("Testing system conversions");
|
||||
PX4_INFO("Testing system conversions");
|
||||
|
||||
for (int i = -10000; i <= 10000; i += 1) {
|
||||
float f = i / 10000.0f;
|
||||
float fres = REG_TO_FLOAT(FLOAT_TO_REG(f));
|
||||
|
||||
if (fabsf(f - fres) > 0.0001f) {
|
||||
warnx("conversion fail: input: %8.4f, intermediate: %d, result: %8.4f", (double)f, REG_TO_SIGNED(FLOAT_TO_REG(f)),
|
||||
PX4_ERR("conversion fail: input: %8.4f, intermediate: %d, result: %8.4f", (double)f, REG_TO_SIGNED(FLOAT_TO_REG(f)),
|
||||
(double)fres);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
warnx("All conversions clean");
|
||||
PX4_INFO("All conversions clean");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user