summaryrefslogtreecommitdiffstats
path: root/test/test-platform/TestPlatform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-platform/TestPlatform.cpp')
-rw-r--r--test/test-platform/TestPlatform.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp
index 91b86fd..0eaa261 100644
--- a/test/test-platform/TestPlatform.cpp
+++ b/test/test-platform/TestPlatform.cpp
@@ -28,6 +28,7 @@
#include <sstream>
#include <assert.h>
#include <errno.h>
+#include <convert.hpp>
#include "TestPlatform.h"
#include "ParameterMgrPlatformConnector.h"
#include "RemoteProcessorServer.h"
@@ -63,9 +64,19 @@ CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber) :
_pCommandHandler->addCommandParser("createInclusiveSelectionCriterion", &CTestPlatform::createInclusiveSelectionCriterionCommandProcess, 2, "<name> <nbStates>", "Create exclusive selection criterion");
_pCommandHandler->addCommandParser("start", &CTestPlatform::startParameterMgrCommandProcess, 0, "", "Start ParameterMgr");
+
_pCommandHandler->addCommandParser("setCriterionState", &CTestPlatform::setCriterionStateCommandProcess, 2, "<name> <state>", "Set the current state of a selection criterion");
_pCommandHandler->addCommandParser("applyConfigurations", &CTestPlatform::applyConfigurationsCommandProcess, 0, "", "Apply configurations selected by current selection criteria states");
+ _pCommandHandler->addCommandParser("setFailureOnMissingSubsystem",
+ &CTestPlatform::setFailureOnMissingSubsystemCommandProcess,
+ 1, "true|false", "Set policy for missing subsystems, "
+ "either abort start or fallback on virtual subsystem");
+ _pCommandHandler->addCommandParser("getMissingSubsystemPolicy",
+ &CTestPlatform::getFailureOnMissingSubsystemCommandProcess,
+ 0, "", "Get policy for missing subsystems, "
+ "either abort start or fallback on virtual subsystem");
+
// Create server
_pRemoteProcessorServer = new CRemoteProcessorServer(iPortNumber, _pCommandHandler);
@@ -127,6 +138,35 @@ CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::startParameterMgrCo
CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed;
}
+CTestPlatform::CCommandHandler::CommandStatus
+ CTestPlatform::setFailureOnMissingSubsystemCommandProcess(
+ const IRemoteCommand& remoteCommand, string& strResult)
+{
+ const string& strAbort = remoteCommand.getArgument(0);
+
+ bool bFail;
+
+ if(!audio_comms::utilities::convertTo(strAbort, bFail)) {
+ return CTestPlatform::CCommandHandler::EShowUsage;
+ }
+
+ return _pParameterMgrPlatformConnector->setFailureOnMissingSubsystem(bFail, strResult) ?
+ CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed;
+}
+
+CTestPlatform::CCommandHandler::CommandStatus
+ CTestPlatform::getFailureOnMissingSubsystemCommandProcess(
+ const IRemoteCommand& remoteCommand, string& strResult)
+{
+ (void)remoteCommand;
+ (void)strResult;
+
+ strResult = _pParameterMgrPlatformConnector->getFailureOnMissingSubsystem() ?
+ "true":"false";
+
+ return CTestPlatform::CCommandHandler::EDone;
+}
+
CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::setCriterionStateCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{