Skip to content
Snippets Groups Projects
Commit 888de4f8 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Fix GUITranslationTests

parent 064138c0
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
// ************************************************************************** //
#include "GUITranslationTest.h"
#include "BeamItem.h"
#include "SimulationFactory.h"
#include "SampleBuilderFactory.h"
#include "GISASSimulation.h"
......@@ -143,6 +144,14 @@ bool GUITranslationTest::isValidDomainName(const std::string& domainName) const
return true;
}
bool GUITranslationTest::isValidGUIName(const std::string& guiName) const
{
std::string beam_polarization = BeamItem::P_POLARIZATION.toStdString();
if(guiName.find(beam_polarization)!=std::string::npos)
return false;
return true;
}
//! Validates GUI translations against simulation parameters. Tries to retrieve fit parameter
//! from domain parameter pool using translated name.
......@@ -155,6 +164,8 @@ bool GUITranslationTest::checkExistingTranslations()
std::unique_ptr<ParameterPool> pool(m_simulation->createParameterTree());
std::vector<ParItem> wrong_translations;
for(auto guiPar : m_translations) {
if (!isValidGUIName(guiPar.parPath))
continue;
try {
pool->getMatchedParameters(guiPar.translatedName);
} catch (const std::runtime_error &/*ex*/) {
......
......@@ -53,6 +53,7 @@ private:
std::string translationResultsToString() const;
bool isValidDomainName(const std::string& domainName) const;
bool isValidGUIName(const std::string& guiName) const;
bool checkExistingTranslations();
bool checkMissedTranslations();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment