mavlink/qgroundcontrol — pull request #450 by DonLakeFlyer (2013-12-28 21:57:12+00:00)
Title: Unit test mocks

Can I get a code review on this?

This creates mock versions of UASManger, UAS and QGCUASParamManger. You can use this to create Unit Tests for most parameter based user interface code. First you call:
UASManager::setMockUASManager
which will cause UASManger::instance to return your mock UASManager implementation. Then you can call the various MockUAS methods to setup you mock UAS up. Then call:
MockUASManager:: setMockActiveUAS
to set it to active. You can then call:
getParamManager
on your mock uas to get the mock QGCUASParamManager. From their you use:
setMockParamaters
getMockSetParameters
to store parameters into the interface and to query what parameters have been changed by the callers. Along the way it will emit all the appropriate signals and so forth to make things work. More details in the comments in the code.

After this goes in I have a reimplemented FlightModeConfig which fixes up a bunch of issues and adds missing functionality. It has an extensive unit test I created which uses all of this.