From ace81f873b910493ab884dc5a6a38ba6ec3d56d3 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Tue, 11 Dec 2012 16:19:17 +0100 Subject: PFW: Do not stop on hard sync errors BZ: 76263 When synchronization fails, the parameter-framework should log a warning and continue synchronization instead of stopping Change-Id: Ic12d8798ea25584db714ee26e644fac793c28881 Signed-off-by: Kevin Rocard Reviewed-on: http://android.intel.com:8080/81825 Reviewed-by: Centelles, Sylvain Reviewed-by: Denneulin, Guillaume Tested-by: Dixon, CharlesX Reviewed-by: cactus Tested-by: cactus --- test/test-platform/TestPlatform.cpp | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'test/test-platform') diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index af741ed..60ee644 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -27,19 +27,25 @@ #include #include #include +#include #include "TestPlatform.h" #include "ParameterMgrPlatformConnector.h" #include "RemoteProcessorServer.h" -#include class CParameterMgrPlatformConnectorLogger : public CParameterMgrPlatformConnector::ILogger { public: CParameterMgrPlatformConnectorLogger() {} - virtual void log(const string& strLog) { + virtual void log(bool bIsWarning, const string& strLog) { + + if (bIsWarning) { - cout << strLog << endl; + cerr << strLog << endl; + } else { + + cout << strLog << endl; + } } }; @@ -92,29 +98,34 @@ bool CTestPlatform::load(std::string& strError) /// Selection Criterion CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createExclusiveSelectionCriterionFromStateListCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { - return createExclusiveSelectionCriterionFromStateList(remoteCommand.getArgument(0), remoteCommand, strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + return createExclusiveSelectionCriterionFromStateList(remoteCommand.getArgument(0), remoteCommand, strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createInclusiveSelectionCriterionFromStateListCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { - return createInclusiveSelectionCriterionFromStateList(remoteCommand.getArgument(0), remoteCommand, strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + return createInclusiveSelectionCriterionFromStateList(remoteCommand.getArgument(0), remoteCommand, strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createExclusiveSelectionCriterionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { - return createExclusiveSelectionCriterion(remoteCommand.getArgument(0), strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + return createExclusiveSelectionCriterion(remoteCommand.getArgument(0), strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createInclusiveSelectionCriterionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { - return createInclusiveSelectionCriterion(remoteCommand.getArgument(0), strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + return createInclusiveSelectionCriterion(remoteCommand.getArgument(0), strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } - CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::startParameterMgrCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { (void)remoteCommand; - return _pParameterMgrPlatformConnector->start(strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + + return _pParameterMgrPlatformConnector->start(strResult) ? + CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::setCriterionStateCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) @@ -147,7 +158,11 @@ CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::setCriterionStateCo CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::applyConfigurationsCommandProcess(const IRemoteCommand& remoteCommand, string& strResult) { (void)remoteCommand; - return _pParameterMgrPlatformConnector->applyConfigurations(strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; + (void)strResult; + + _pParameterMgrPlatformConnector->applyConfigurations(); + + return CTestPlatform::CCommandHandler::EDone; } //////////////// Remote command handlers -- cgit v1.1