Commit 8b46d4e6 authored by Don Gagne's avatar Don Gagne

Merge pull request #1731 from DonLakeFlyer/UTParamMetaData

Unit test always use resource based meta data
parents d6a13203 1ee424af
......@@ -92,11 +92,16 @@ void PX4ParameterLoader::loadParameterFactMetaData(void)
Q_ASSERT(_mapParameterName2FactMetaData.count() == 0);
// First look for meta data that comes from a firmware download. Fall back to resource if not there.
QSettings settings;
QDir parameterDir = QFileInfo(settings.fileName()).dir();
QString parameterFilename = parameterDir.filePath("PX4ParameterFactMetaData.xml");
if (!QFile(parameterFilename).exists()) {
QString parameterFilename;
// We want unit test builds to always use the resource based meta data to provide repeatable results
if (!qgcApp()->runningUnitTests()) {
// First look for meta data that comes from a firmware download. Fall back to resource if not there.
QSettings settings;
QDir parameterDir = QFileInfo(settings.fileName()).dir();
parameterFilename = parameterDir.filePath("PX4ParameterFactMetaData.xml");
}
if (parameterFilename.isEmpty() || !QFile(parameterFilename).exists()) {
parameterFilename = ":/AutoPilotPlugins/PX4/ParameterFactMetaData.xml";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment