summaryrefslogtreecommitdiffstats
path: root/test/test-platform
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2013-07-18 09:13:51 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:07 +0100
commit325bf97a49f9d1225a7815de8bd9c16b556d5070 (patch)
tree8689227ee0dd8942d8ddf4d8c70ce8150b5f2ff1 /test/test-platform
parent2448cf71ad24cbbcbbc89cc7522c431413617692 (diff)
downloadexternal_parameter-framework-325bf97a49f9d1225a7815de8bd9c16b556d5070.zip
external_parameter-framework-325bf97a49f9d1225a7815de8bd9c16b556d5070.tar.gz
external_parameter-framework-325bf97a49f9d1225a7815de8bd9c16b556d5070.tar.bz2
Wrap lines too longs and add doxygen
BZ: 122982 Some lines were not compliant with the coding style. Wrap them and add doxigen. Change-Id: I5271b78b1e879a39914a4405a58d7366148b6972 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/119424 Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'test/test-platform')
-rw-r--r--test/test-platform/TestPlatform.cpp86
-rw-r--r--test/test-platform/TestPlatform.h64
2 files changed, 105 insertions, 45 deletions
diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp
index 0eaa261..1825b88 100644
--- a/test/test-platform/TestPlatform.cpp
+++ b/test/test-platform/TestPlatform.cpp
@@ -57,23 +57,43 @@ CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber) :
_pCommandHandler = new CCommandHandler(this);
// Add command parsers
- _pCommandHandler->addCommandParser("createExclusiveSelectionCriterionFromStateList", &CTestPlatform::createExclusiveSelectionCriterionFromStateListCommandProcess, 2, "<name> <stateList>", "Create inclusive selection criterion from state name list");
- _pCommandHandler->addCommandParser("createInclusiveSelectionCriterionFromStateList", &CTestPlatform::createInclusiveSelectionCriterionFromStateListCommandProcess, 2, "<name> <stateList>", "Create exclusive selection criterion from state name list");
-
- _pCommandHandler->addCommandParser("createExclusiveSelectionCriterion", &CTestPlatform::createExclusiveSelectionCriterionCommandProcess, 2, "<name> <nbStates>", "Create inclusive selection criterion");
- _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(
+ "createExclusiveSelectionCriterionFromStateList",
+ &CTestPlatform::createExclusiveSelectionCriterionFromStateList,
+ 2, "<name> <stateList>",
+ "Create inclusive selection criterion from state name list");
+ _pCommandHandler->addCommandParser(
+ "createInclusiveSelectionCriterionFromStateList",
+ &CTestPlatform::createInclusiveSelectionCriterionFromStateList,
+ 2, "<name> <stateList>",
+ "Create exclusive selection criterion from state name list");
+
+ _pCommandHandler->addCommandParser(
+ "createExclusiveSelectionCriterion",
+ &CTestPlatform::createExclusiveSelectionCriterion,
+ 2, "<name> <nbStates>", "Create inclusive selection criterion");
+ _pCommandHandler->addCommandParser(
+ "createInclusiveSelectionCriterion",
+ &CTestPlatform::createInclusiveSelectionCriterion,
+ 2, "<name> <nbStates>", "Create exclusive selection criterion");
+
+ _pCommandHandler->addCommandParser("start", &CTestPlatform::startParameterMgr,
+ 0, "", "Start ParameterMgr");
+
+ _pCommandHandler->addCommandParser("setCriterionState", &CTestPlatform::setCriterionState,
+ 2, "<name> <state>",
+ "Set the current state of a selection criterion");
+ _pCommandHandler->addCommandParser(
+ "applyConfigurations",
+ &CTestPlatform::applyConfigurations,
+ 0, "", "Apply configurations selected by current selection criteria states");
_pCommandHandler->addCommandParser("setFailureOnMissingSubsystem",
- &CTestPlatform::setFailureOnMissingSubsystemCommandProcess,
+ &CTestPlatform::setFailureOnMissingSubsystem,
1, "true|false", "Set policy for missing subsystems, "
"either abort start or fallback on virtual subsystem");
_pCommandHandler->addCommandParser("getMissingSubsystemPolicy",
- &CTestPlatform::getFailureOnMissingSubsystemCommandProcess,
+ &CTestPlatform::getFailureOnMissingSubsystem,
0, "", "Get policy for missing subsystems, "
"either abort start or fallback on virtual subsystem");
@@ -106,31 +126,44 @@ bool CTestPlatform::load(std::string& strError)
//////////////// Remote command parsers
/// Selection Criterion
-CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createExclusiveSelectionCriterionFromStateListCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
+CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterionFromStateList(
+ const IRemoteCommand& remoteCommand, string& strResult)
{
- return createExclusiveSelectionCriterionFromStateList(remoteCommand.getArgument(0), remoteCommand, strResult) ?
+ return createExclusiveSelectionCriterionFromStateList(
+ remoteCommand.getArgument(0), remoteCommand, strResult) ?
CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed;
}
-CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createInclusiveSelectionCriterionFromStateListCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
+CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterionFromStateList(
+ const IRemoteCommand& remoteCommand, string& strResult)
{
- return createInclusiveSelectionCriterionFromStateList(remoteCommand.getArgument(0), remoteCommand, strResult) ?
+ return createInclusiveSelectionCriterionFromStateList(
+ remoteCommand.getArgument(0), remoteCommand, strResult) ?
CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed;
}
-CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::createExclusiveSelectionCriterionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
+CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterion(
+ const IRemoteCommand& remoteCommand, string& strResult)
{
- return createExclusiveSelectionCriterion(remoteCommand.getArgument(0), strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), strResult) ?
+ 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)
+CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterion(
+ const IRemoteCommand& remoteCommand, string& strResult)
{
- return createInclusiveSelectionCriterion(remoteCommand.getArgument(0), strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), strResult) ?
+ 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)
+CTestPlatform::CommandReturn CTestPlatform::startParameterMgr(
+ const IRemoteCommand& remoteCommand, string& strResult)
{
(void)remoteCommand;
@@ -138,8 +171,7 @@ CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::startParameterMgrCo
CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed;
}
-CTestPlatform::CCommandHandler::CommandStatus
- CTestPlatform::setFailureOnMissingSubsystemCommandProcess(
+CTestPlatform::CommandReturn CTestPlatform::setFailureOnMissingSubsystem(
const IRemoteCommand& remoteCommand, string& strResult)
{
const string& strAbort = remoteCommand.getArgument(0);
@@ -154,8 +186,7 @@ CTestPlatform::CCommandHandler::CommandStatus
CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed;
}
-CTestPlatform::CCommandHandler::CommandStatus
- CTestPlatform::getFailureOnMissingSubsystemCommandProcess(
+CTestPlatform::CommandReturn CTestPlatform::getFailureOnMissingSubsystem(
const IRemoteCommand& remoteCommand, string& strResult)
{
(void)remoteCommand;
@@ -167,7 +198,8 @@ CTestPlatform::CCommandHandler::CommandStatus
return CTestPlatform::CCommandHandler::EDone;
}
-CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::setCriterionStateCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
+CTestPlatform::CommandReturn CTestPlatform::setCriterionState(
+ const IRemoteCommand& remoteCommand, string& strResult)
{
bool bSuccess;
@@ -194,7 +226,7 @@ CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::setCriterionStateCo
}
-CTestPlatform::CCommandHandler::CommandStatus CTestPlatform::applyConfigurationsCommandProcess(const IRemoteCommand& remoteCommand, string& strResult)
+CTestPlatform::CommandReturn CTestPlatform::applyConfigurations(const IRemoteCommand& remoteCommand, string& strResult)
{
(void)remoteCommand;
(void)strResult;
diff --git a/test/test-platform/TestPlatform.h b/test/test-platform/TestPlatform.h
index 47f81f8..a415a85 100644
--- a/test/test-platform/TestPlatform.h
+++ b/test/test-platform/TestPlatform.h
@@ -38,6 +38,7 @@ class ISelectionCriterionInterface;
class CTestPlatform
{
typedef TRemoteCommandHandlerTemplate<CTestPlatform> CCommandHandler;
+ typedef CCommandHandler::CommandStatus CommandReturn;
public:
CTestPlatform(const string &strclass, int iPortNumber);
virtual ~CTestPlatform();
@@ -48,34 +49,61 @@ public:
private:
//////////////// Remote command parsers
/// Selection Criterion
- CCommandHandler::CommandStatus createExclusiveSelectionCriterionFromStateListCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CCommandHandler::CommandStatus createInclusiveSelectionCriterionFromStateListCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CommandReturn createExclusiveSelectionCriterionFromStateList(
+ const IRemoteCommand& remoteCommand, string& strResult);
+ CommandReturn createInclusiveSelectionCriterionFromStateList(
+ const IRemoteCommand& remoteCommand, string& strResult);
- CCommandHandler::CommandStatus createExclusiveSelectionCriterionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CCommandHandler::CommandStatus createInclusiveSelectionCriterionCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CCommandHandler::CommandStatus startParameterMgrCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CCommandHandler::CommandStatus setCriterionStateCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
- CCommandHandler::CommandStatus applyConfigurationsCommandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CommandReturn createExclusiveSelectionCriterion(
+ const IRemoteCommand& remoteCommand, string& strResult);
+ CommandReturn createInclusiveSelectionCriterion(
+ const IRemoteCommand& remoteCommand, string& strResult);
- /** Callback to set if the PFW start should fail in case of missing subsystems.
+ /** Callback to set a criterion's value, see ISelectionCriterionInterface::setCriterionState.
+ * @see CCommandHandler::RemoteCommandParser for detail on each arguments and return
+ *
+ * @param[in] remoteCommand the first argument should be the name of the criterion to set.
+ * if the criterion is provided in lexical space,
+ * the folowing arguments should be criterion new values
+ * if the criterion is provided in numerical space,
+ * the second argument should be the criterion new value
+ */
+ CommandReturn setCriterionState(
+ const IRemoteCommand& remoteCommand, string& strResult);
+
+ /** Callback to start the PFW, see CParameterMgrPlatformConnector::start.
+ * @see CCommandHandler::RemoteCommandParser for detail on each arguments and return
*
- * @param[in] remoteCommand contains the arguments of the received command.
- * @param[out] strResult a string containing the result of the command.
+ * @param[in] remoteCommand is ignored
+ */
+ CommandReturn startParameterMgr(
+ const IRemoteCommand& remoteCommand, string& strResult);
+
+ /** Callback to apply PFW configuration, see CParameterMgrPlatformConnector::applyConfiguration.
+ * @see CCommandHandler::RemoteCommandParser for detail on each arguments and return
+ *
+ * @param[in] remoteCommand is ignored
+ *
+ * @return EDone (never fails)
+ */
+ CommandReturn applyConfigurations(
+ const IRemoteCommand& remoteCommand, string& strResult);
+
+ /** Callback to set if the PFW start should fail in case of missing subsystems.
+ * @see CCommandHandler::RemoteCommandParser for detail on each arguments and return
*
- * @return CCommandHandler::ESucceeded if command succeeded
- * or CCommandHandler::EFailed otherwise
+ * @param[in] remoteCommand the first argument should be ether "on" or "off".
*/
- CCommandHandler::CommandStatus setFailureOnMissingSubsystemCommandProcess(
+ CommandReturn setFailureOnMissingSubsystem(
const IRemoteCommand& remoteCommand, string& strResult);
/** Callback to get if the PFW start should fail in case of missing subsystems.
+ * @see CCommandHandler::RemoteCommandParser for detail on each arguments and return
*
- * @param[in] remoteCommand contains the arguments of the received command.
- * @param[out] strResult a string containing the result of the command.
+ * @param[in] remoteCommand is ignored
*
- * @return CCommandHandler::ESucceeded if command succeeded
- * or CCommandHandler::EFailed otherwise
+ * @return EDone (never fails)
*/
- CCommandHandler::CommandStatus getFailureOnMissingSubsystemCommandProcess(
+ CommandReturn getFailureOnMissingSubsystem(
const IRemoteCommand& remoteCommand, string& strResult);
// Commands