Browse Source

Extend mixer test case with complex mixer

sbg
Lorenz Meier 8 years ago committed by Daniel Agar
parent
commit
d0dbddea1b
  1. 28
      ROMFS/px4fmu_test/mixers/complex_test.mix
  2. 47
      src/systemcmds/tests/test_mixer.cpp

28
ROMFS/px4fmu_test/mixers/complex_test.mix

@ -0,0 +1,28 @@ @@ -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

47
src/systemcmds/tests/test_mixer.cpp

@ -99,6 +99,7 @@ private: @@ -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) @@ -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) @@ -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 @@ -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()
{
/*

Loading…
Cancel
Save