diff options
author | Frédéric Boisnard <fredericx.boisnard@intel.com> | 2012-09-10 12:10:48 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:03:13 +0100 |
commit | 951ecce4fbf195694b14ef8504c59732354abcdb (patch) | |
tree | 00db449704a1ff8fd0c92d285141935bc861154b /test | |
parent | 997e709c17c6b19459db698f10c0fe60d393bdaa (diff) | |
download | external_parameter-framework-951ecce4fbf195694b14ef8504c59732354abcdb.zip external_parameter-framework-951ecce4fbf195694b14ef8504c59732354abcdb.tar.gz external_parameter-framework-951ecce4fbf195694b14ef8504c59732354abcdb.tar.bz2 |
PFW: Allow custom port number in test-platform
BZ: 56440
This patch aims to allow custom port number in test-platform:
test-platform <file path> [port number, default 5001]
Change-Id: Ia617507045a58d0e79a5dc1df83b0173c968853a
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Reviewed-on: http://android.intel.com:8080/65412
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com>
Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com>
Tested-by: Mendi, EduardoX <eduardox.mendi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/test-platform/TestPlatform.cpp | 4 | ||||
-rw-r--r-- | test/test-platform/TestPlatform.h | 2 | ||||
-rw-r--r-- | test/test-platform/main.cpp | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index fff0a8d..af741ed 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -44,7 +44,7 @@ public: }; -CTestPlatform::CTestPlatform(const string& strClass) : +CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber) : _pParameterMgrPlatformConnector(new CParameterMgrPlatformConnector(strClass)), _pParameterMgrPlatformConnectorLogger(new CParameterMgrPlatformConnectorLogger) { @@ -62,7 +62,7 @@ CTestPlatform::CTestPlatform(const string& strClass) : _pCommandHandler->addCommandParser("applyConfigurations", &CTestPlatform::applyConfigurationsCommandProcess, 0, "", "Apply configurations selected by current selection criteria states"); // Create server - _pRemoteProcessorServer = new CRemoteProcessorServer(5001, _pCommandHandler); + _pRemoteProcessorServer = new CRemoteProcessorServer(iPortNumber, _pCommandHandler); _pParameterMgrPlatformConnector->setLogger(_pParameterMgrPlatformConnectorLogger); } diff --git a/test/test-platform/TestPlatform.h b/test/test-platform/TestPlatform.h index 566fdc8..8a3e59c 100644 --- a/test/test-platform/TestPlatform.h +++ b/test/test-platform/TestPlatform.h @@ -39,7 +39,7 @@ class CTestPlatform { typedef TRemoteCommandHandlerTemplate<CTestPlatform> CCommandHandler; public: - CTestPlatform(const string &strclass); + CTestPlatform(const string &strclass, int iPortNumber); virtual ~CTestPlatform(); // Init diff --git a/test/test-platform/main.cpp b/test/test-platform/main.cpp index 8e2e17c..1cd1594 100644 --- a/test/test-platform/main.cpp +++ b/test/test-platform/main.cpp @@ -26,6 +26,7 @@ #include <semaphore.h> #include "TestPlatform.h" #include <semaphore.h> +#include <stdlib.h> using namespace std; @@ -37,11 +38,13 @@ const char* gpcParameterFrameworkConfigurationFolderPath = "/etc/parameter-frame #endif */ +const int iDefaultPortNumber = 5001; + int main(int argc, char *argv[]) { if (argc < 2) { - cerr << "Missing arguments" << endl; + cerr << "Missing arguments: test-platform <file path> [port number, default " << iDefaultPortNumber << "]" << endl; return -1; } @@ -49,7 +52,7 @@ int main(int argc, char *argv[]) string strError; // Create param mgr - CTestPlatform testPlatform(argv[1]); + CTestPlatform testPlatform(argv[1], argc > 2 ? atoi(argv[2]) : iDefaultPortNumber); // Start platformmgr if (!testPlatform.load(strError)) { |