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 EGL common defines and types
22 *//*--------------------------------------------------------------------*/
24 #include "egluDefs.hpp"
25 #include "egluStrUtil.hpp"
26 #include "egluConfigInfo.hpp"
27 #include "eglwLibrary.hpp"
28 #include "eglwEnums.hpp"
39 void checkError (deUint32 err, const char* message, const char* file, int line)
41 if (err != EGL_SUCCESS)
43 std::ostringstream desc;
44 desc << "Got " << eglu::getErrorStr(err);
46 desc << ": " << message;
48 if (err == EGL_BAD_ALLOC)
49 throw BadAllocError(desc.str().c_str(), DE_NULL, file, line);
51 throw Error(err, desc.str().c_str(), DE_NULL, file, line);
55 Error::Error (deUint32 errCode, const char* errStr)
56 : tcu::TestError ((std::string("EGL returned ") + getErrorName(errCode)).c_str(), errStr ? errStr : "", __FILE__, __LINE__)
61 Error::Error (deUint32 errCode, const char* message, const char* expr, const char* file, int line)
62 : tcu::TestError (message, expr, file, line)
67 BadAllocError::BadAllocError (const char* errStr)
68 : tcu::ResourceError(errStr)
72 BadAllocError::BadAllocError (const char* message, const char* expr, const char* file, int line)
73 : tcu::ResourceError(message, expr, file, line)
77 bool Version::operator< (const Version& v) const
79 if (m_major < v.m_major) return true;
80 else if (m_major > v.m_major) return false;
82 if (m_minor < v.m_minor) return true;
87 bool Version::operator== (const Version& v) const
89 if (m_major == v.m_major && m_minor == v.m_minor) return true;
94 bool Version::operator!= (const Version& v) const
99 bool Version::operator> (const Version& v) const
101 return !(*this < v && *this == v);
104 bool Version::operator<= (const Version& v) const
106 return (*this < v && *this == v);
109 bool Version::operator>= (const Version& v) const