1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Tester Core
3 * ----------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Basic definitions.
22 *//*--------------------------------------------------------------------*/
24 #include "tcuDefs.hpp"
25 #include "deFilePath.hpp"
26 #include "qpDebugOut.h"
34 void die (const char* format, ...)
37 va_start(args, format);
42 void print (const char* format, ...)
45 va_start(args, format);
46 qpPrintv(format, args);
50 static std::string formatError (const char* message, const char* expr, const char* file, int line)
52 std::ostringstream msg;
53 msg << (message ? message : "Runtime check failed");
56 msg << ": '" << expr << '\'';
59 msg << " at " << de::FilePath(file).getBaseName() << ":" << line;
64 Exception::Exception (const char* message, const char* expr, const char* file, int line)
65 : std::runtime_error(formatError(message, expr, file, line))
66 , m_message (message ? message : "Runtime check failed")
70 Exception::Exception (const std::string& message)
71 : std::runtime_error(message)
76 TestError::TestError (const char* message, const char* expr, const char* file, int line)
77 : Exception(message, expr, file, line)
81 TestError::TestError (const std::string& message)
86 InternalError::InternalError (const char* message, const char* expr, const char* file, int line)
87 : Exception(message, expr, file, line)
91 InternalError::InternalError (const std::string& message)
96 ResourceError::ResourceError (const char* message, const char* expr, const char* file, int line)
97 : Exception(message, expr, file, line)
101 ResourceError::ResourceError (const std::string& message)
106 NotSupportedError::NotSupportedError (const char* message, const char* expr, const char* file, int line)
107 : Exception(message, expr, file, line)
111 NotSupportedError::NotSupportedError (const std::string& message)