From d0dbddea1beba58df5bbe7f9e8b04e4a94b39cbf Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 1 Jan 2017 20:41:58 +0100 Subject: [PATCH] Extend mixer test case with complex mixer --- ROMFS/px4fmu_test/mixers/complex_test.mix | 28 ++++++++++++++ src/systemcmds/tests/test_mixer.cpp | 47 +++++++++++++---------- 2 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 ROMFS/px4fmu_test/mixers/complex_test.mix diff --git a/ROMFS/px4fmu_test/mixers/complex_test.mix b/ROMFS/px4fmu_test/mixers/complex_test.mix new file mode 100644 index 0000000000..626ce556bf --- /dev/null +++ b/ROMFS/px4fmu_test/mixers/complex_test.mix @@ -0,0 +1,28 @@ +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 0 10000 10000 0 -10000 10000 +S: 0 1 10000 10000 0 -10000 10000 +S: 0 2 10000 10000 0 -10000 10000 +S: 0 3 10000 10000 0 -10000 10000 +S: 0 4 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 1 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 2 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 3 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 4 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 5 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 6 10000 10000 0 -10000 10000 +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 7 10000 10000 0 -10000 10000 diff --git a/src/systemcmds/tests/test_mixer.cpp b/src/systemcmds/tests/test_mixer.cpp index c4b7fdafb0..14d9351401 100644 --- a/src/systemcmds/tests/test_mixer.cpp +++ b/src/systemcmds/tests/test_mixer.cpp @@ -99,6 +99,7 @@ private: bool loadVTOL1Test(); bool loadVTOL2Test(); bool loadQuadTest(); + bool loadComplexTest(); bool load_mixer(const char *filename, unsigned expected_count, bool verbose = false); bool load_mixer(const char *buf, unsigned loaded, unsigned expected_count, const unsigned chunk_size, bool verbose); @@ -116,6 +117,7 @@ bool MixerTest::run_tests(void) ut_run_test(loadQuadTest); ut_run_test(loadVTOL1Test); ut_run_test(loadVTOL2Test); + ut_run_test(loadComplexTest); ut_run_test(mixerTest); return (_tests_failed == 0); @@ -123,6 +125,31 @@ bool MixerTest::run_tests(void) ut_declare_test_c(test_mixer, MixerTest) +bool MixerTest::loadIOPass() +{ + return load_mixer(MIXER_PATH(IO_pass.mix), 8); +} + +bool MixerTest::loadQuadTest() +{ + return load_mixer(MIXER_PATH(quad_test.mix), 5); +} + +bool MixerTest::loadVTOL1Test() +{ + return load_mixer(MIXER_PATH(vtol1_test.mix), 4); +} + +bool MixerTest::loadVTOL2Test() +{ + return load_mixer(MIXER_PATH(vtol2_test.mix), 6); +} + +bool MixerTest::loadComplexTest() +{ + return load_mixer(MIXER_PATH(complex_test.mix), 8); +} + bool MixerTest::load_mixer(const char *filename, unsigned expected_count, bool verbose) { char buf[2048]; @@ -232,26 +259,6 @@ bool MixerTest::load_mixer(const char *buf, unsigned loaded, unsigned expected_c return true; } -bool MixerTest::loadIOPass() -{ - return load_mixer(MIXER_PATH(IO_pass.mix), 8); -} - -bool MixerTest::loadQuadTest() -{ - return load_mixer(MIXER_PATH(quad_test.mix), 5); -} - -bool MixerTest::loadVTOL1Test() -{ - return load_mixer(MIXER_PATH(vtol1_test.mix), 4); -} - -bool MixerTest::loadVTOL2Test() -{ - return load_mixer(MIXER_PATH(vtol2_test.mix), 6); -} - bool MixerTest::mixerTest() { /*