Merge branch 'cynara' into tizen
[platform/core/test/security-tests.git] / src / framework / src / test_runner_child.cpp
index b4157ba..e2efb02 100644 (file)
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
-/*
+/**
  * @file        test_runner_child.cpp
  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
  * @version     1.0
  * @brief       This file is the implementation file of test runner
  */
 #include <stddef.h>
+#include <dpl/test/test_failed.h>
+#include <dpl/test/test_ignored.h>
 #include <dpl/test/test_runner.h>
 #include <dpl/test/test_runner_child.h>
 #include <dpl/test/test_results_collector.h>
@@ -289,13 +291,13 @@ void RunChildProc(TestRunner::TestCase procChild)
 {
     PipeWrapper pipe;
     if (!pipe.isReady()) {
-        throw TestRunner::TestFailed("Pipe creation failed");
+        throw TestFailed("Pipe creation failed");
     }
 
     pid_t pid = fork();
 
     if (pid == -1) {
-        throw TestRunner::TestFailed("Child creation failed");
+        throw TestFailed("Child creation failed");
     }
 
     if (pid != 0) {
@@ -317,19 +319,19 @@ void RunChildProc(TestRunner::TestCase procChild)
         waitpid(pid, &status, 0);
 
         if (pipeReturn == PipeWrapper::TIMEOUT) {
-            throw TestRunner::TestFailed("Timeout");
+            throw TestFailed("Timeout");
         }
 
         if (pipeReturn == PipeWrapper::ERROR) {
-            throw TestRunner::TestFailed("Reading pipe error");
+            throw TestFailed("Reading pipe error");
         }
 
         TestRunnerSingleton::Instance().setCurrentTestCasePerformanceResult(performance);
 
         if (code == CHILD_TEST_FAIL) {
-            throw TestRunner::TestFailed(message);
+            throw TestFailed(message);
         } else if (code == CHILD_TEST_IGNORED) {
-            throw TestRunner::Ignored(message);
+            throw TestIgnored(message);
         }
     } else {
         // child code
@@ -351,10 +353,10 @@ void RunChildProc(TestRunner::TestCase procChild)
 
         try {
             procChild();
-        } catch (const DPL::Test::TestRunner::TestFailed &e) {
+        } catch (const DPL::Test::TestFailed &e) {
             msg = e.GetMessage();
             code = CHILD_TEST_FAIL;
-        } catch (const DPL::Test::TestRunner::Ignored &e) {
+        } catch (const DPL::Test::TestIgnored &e) {
             msg = e.GetMessage();
             code = CHILD_TEST_IGNORED;
         } catch (...) { // catch all exception generated by "user" code