Extend mixer test case with complex mixer

This commit is contained in:
Lorenz Meier 2017-01-01 20:41:58 +01:00 committed by Daniel Agar
parent 51a89b74fb
commit d0dbddea1b
2 changed files with 55 additions and 20 deletions

View File

@ -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

View File

@ -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()
{
/*