Enable use of std::string in TCU_FAIL macro
authorBoris Zanin <boris.zanin@mobica.com>
Thu, 16 Mar 2017 12:08:20 +0000 (13:08 +0100)
committerPyry Haulos <phaulos@google.com>
Thu, 16 Mar 2017 14:36:58 +0000 (09:36 -0500)
Extend TestError class with a constructor that accepts
std:string as a first parameter in 4-parameter constructor.
This enables to use statements like TCU_FAIL(std::string).

Components: Framework

VK-GL-CTS issue: 260

Change-Id: Ib7cf3eedd8eb22f3cdf9603e56e3fbcc69644d64

framework/common/tcuDefs.cpp
framework/common/tcuDefs.hpp

index 10eb1fa..639f971 100644 (file)
@@ -89,6 +89,10 @@ TestError::TestError (const char* message, const char* expr, const char* file, i
        : TestException(message, expr, file, line, QP_TEST_RESULT_FAIL)
 {
 }
+TestError::TestError (const std::string& message, const char* expr, const char* file, int line)
+       : TestException(message.c_str(), expr, file, line, QP_TEST_RESULT_FAIL)
+{
+}
 
 TestError::TestError (const std::string& message)
        : TestException(message, QP_TEST_RESULT_FAIL)
index 047c64f..b2a03df 100644 (file)
@@ -78,6 +78,7 @@ class TestError : public TestException
 {
 public:
                                        TestError                       (const char* message, const char* expr, const char* file, int line);
+                                       TestError                       (const std::string& message, const char* expr, const char* file, int line);
                                        TestError                       (const std::string& message);
        virtual                 ~TestError                      (void) throw() {}
 };