diff options
Diffstat (limited to 'test/test-platform/main.cpp')
-rw-r--r-- | test/test-platform/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/test-platform/main.cpp b/test/test-platform/main.cpp index 953d649..d97a449 100644 --- a/test/test-platform/main.cpp +++ b/test/test-platform/main.cpp @@ -44,24 +44,27 @@ int main(int argc, char *argv[]) string strError; + // Init semaphore + sem_t sem; + + sem_init(&sem, false, 0); + // Create param mgr - CTestPlatform testPlatform(argv[1], argc > 2 ? atoi(argv[2]) : iDefaultPortNumber); + CTestPlatform testPlatform(argv[1], argc > 2 ? atoi(argv[2]) : iDefaultPortNumber, sem); // Start platformmgr if (!testPlatform.load(strError)) { cerr << strError << endl; + sem_destroy(&sem); + return -1; } // Change criteria // Block here - sem_t sem; - - sem_init(&sem, false, 0); - sem_wait(&sem); sem_destroy(&sem); |