diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-03-28 19:51:15 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-03-28 19:51:15 +0100 |
commit | 32e790110e766c0f6fbd5c439d15f2649df2c542 (patch) | |
tree | 699d9ee1cab7e50b086b7367924cd462189cf02a /src/systemcmds/tests/test_conv.cpp | |
parent | b24af0f402ed5512d078c7afc0aa92e7ce1c166b (diff) | |
download | px4-firmware-32e790110e766c0f6fbd5c439d15f2649df2c542.tar.gz px4-firmware-32e790110e766c0f6fbd5c439d15f2649df2c542.tar.bz2 px4-firmware-32e790110e766c0f6fbd5c439d15f2649df2c542.zip |
Tests: Fix code style on system tests
Diffstat (limited to 'src/systemcmds/tests/test_conv.cpp')
-rw-r--r-- | src/systemcmds/tests/test_conv.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/systemcmds/tests/test_conv.cpp b/src/systemcmds/tests/test_conv.cpp index fda949c61..9a41b19b9 100644 --- a/src/systemcmds/tests/test_conv.cpp +++ b/src/systemcmds/tests/test_conv.cpp @@ -61,11 +61,13 @@ int test_conv(int argc, char *argv[]) { warnx("Testing system conversions"); - for (int i = -10000; i <= 10000; i+=1) { - float f = i/10000.0f; + 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)), (double)fres); + warnx("conversion fail: input: %8.4f, intermediate: %d, result: %8.4f", (double)f, REG_TO_SIGNED(FLOAT_TO_REG(f)), + (double)fres); return 1; } } |