diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test-platform/TestPlatform.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index b2b895c..e4b7ee1 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -462,30 +462,35 @@ bool CTestPlatform::setCriterionStateByLexicalSpace(const IRemoteCommand& remote } /// Translate lexical state to numerical state - uint32_t uiNumericalState = 0; + int iNumericalState = 0; uint32_t uiLexicalSubStateIndex; // Parse lexical substates + std::string strLexicalState = ""; for (uiLexicalSubStateIndex = 1; uiLexicalSubStateIndex <= uiNbSubStates; uiLexicalSubStateIndex++) { + /* + * getNumericalValue method from ISelectionCriterionTypeInterface strip his parameter + * first parameter based on | sign. In case that the user uses multiple parameters + * to set InclusiveCriterion value, we aggregate all desired values to be sure + * they will be handled correctly. + */ + if (uiLexicalSubStateIndex != 1) { + strLexicalState += "|"; + } + strLexicalState += remoteCommand.getArgument(uiLexicalSubStateIndex); + } - int iNumericalSubState; - - const std::string& strLexicalSubState = remoteCommand.getArgument(uiLexicalSubStateIndex); - - // Translate lexical to numerical substate - if (!pCriterionType->getNumericalValue(strLexicalSubState, iNumericalSubState)) { - - strResult = "Unable to find lexical state \"" + strLexicalSubState + "\" in criteria " + strCriterionName; + // Translate lexical to numerical substate + if (!pCriterionType->getNumericalValue(strLexicalState, iNumericalState)) { - return false; - } + strResult = "Unable to find lexical state \"" + + strLexicalState + "\" in criteria " + strCriterionName; - // Aggregate numerical substates - uiNumericalState |= iNumericalSubState; + return false; } // Set criterion new state - pCriterion->setCriterionState(uiNumericalState); + pCriterion->setCriterionState(iNumericalState); return true; } |