Fix existing viewport_array bugs
[platform/upstream/VK-GL-CTS.git] / external / openglcts / modules / common / glcViewportArrayTests.cpp
index 4d0b7db..a3170a7 100644 (file)
@@ -48,117 +48,6 @@ namespace glcts
 
 namespace ViewportArray
 {
-/** Check if extension is supported
- *
- * @param context        Test context
- * @param extension_name Name of extension
- *
- * @return true if extension is supported, false otherwise
- **/
-bool Utils::isExtensionSupported(deqp::Context& context, const GLchar* extension_name)
-{
-       const std::vector<std::string>& extensions = context.getContextInfo().getExtensions();
-
-       if (std::find(extensions.begin(), extensions.end(), extension_name) == extensions.end())
-       {
-               return false;
-       }
-
-       return true;
-}
-
-/** Check if GL context meets version requirements
- *
- * @param gl             Functions
- * @param required_major Minimum required MAJOR_VERSION
- * @param required_minor Minimum required MINOR_VERSION
- *
- * @return true if GL context version is at least as requested, false otherwise
- **/
-bool Utils::isGLVersionAtLeast(const glw::Functions& gl, glw::GLint required_major, glw::GLint required_minor)
-{
-       glw::GLint major = 0;
-       glw::GLint minor = 0;
-
-       gl.getIntegerv(GL_MAJOR_VERSION, &major);
-       gl.getIntegerv(GL_MINOR_VERSION, &minor);
-
-       GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
-
-       if (major > required_major)
-       {
-               /* Major is higher than required one */
-               return true;
-       }
-       else if (major == required_major)
-       {
-               if (minor >= required_minor)
-               {
-                       /* Major is equal to required one */
-                       /* Minor is higher than or equal to required one */
-                       return true;
-               }
-               else
-               {
-                       /* Major is equal to required one */
-                       /* Minor is lower than required one */
-                       return false;
-               }
-       }
-       else
-       {
-               /* Major is lower than required one */
-               return false;
-       }
-}
-
-/** Replace first occurance of <token> with <text> in <string> starting at <search_posistion>
- *
- * @param token           Token string
- * @param search_position Position at which find will start, it is updated to position at which replaced text ends
- * @param text            String that will be used as replacement for <token>
- * @param string          String to work on
- **/
-void Utils::replaceToken(const glw::GLchar* token, size_t& search_position, const glw::GLchar* text,
-                                                std::string& string)
-{
-       const size_t text_length        = strlen(text);
-       const size_t token_length   = strlen(token);
-       const size_t token_position = string.find(token, search_position);
-
-       string.replace(token_position, token_length, text, text_length);
-
-       search_position = token_position + text_length;
-}
-
-/** Replace all occurances of <token> with <text> in <string>
- *
- * @param token           Token string
- * @param text            String that will be used as replacement for <token>
- * @param string          String to work on
- **/
-void Utils::replaceAllTokens(const glw::GLchar* token, const glw::GLchar* text, std::string& string)
-{
-       const size_t text_length  = strlen(text);
-       const size_t token_length = strlen(token);
-
-       size_t search_position = 0;
-
-       while (1)
-       {
-               const size_t token_position = string.find(token, search_position);
-
-               if (std::string::npos == token_position)
-               {
-                       break;
-               }
-
-               search_position = token_position + text_length;
-
-               string.replace(token_position, token_length, text, text_length);
-       }
-}
-
 /** Constructor.
  *
  * @param context CTS context.
@@ -1553,7 +1442,7 @@ tcu::TestNode::IterateResult Queries::iterate()
 
                for (GLint i = 0; i < max_viewports; ++i)
                {
-                       gl.getIntegeri_v(GL_VIEWPORT, i, &data[i * 4]);
+                       gl.getIntegeri_v(GL_SCISSOR_BOX, i, &data[i * 4]);
                        GLU_EXPECT_NO_ERROR(gl.getError(), "getIntegeri_v");
                }
 
@@ -1623,11 +1512,11 @@ tcu::TestNode::IterateResult Queries::iterate()
         *   at least [-32768, 32767];
         */
        {
-               if ((-32768.0f < viewport_bounds_range[0]) || (32768.0f > viewport_bounds_range[1]))
+               if ((-32768.0f < viewport_bounds_range[0]) || (32767.0f > viewport_bounds_range[1]))
                {
                        m_context.getTestContext().getLog()
                                << tcu::TestLog::Message << "Invalid VIEWPORT_BOUNDS_RANGE: " << viewport_bounds_range[0] << " : "
-                               << viewport_bounds_range[1] << " expected at least: -32768.0f : 32768.0f" << tcu::TestLog::EndMessage;
+                               << viewport_bounds_range[1] << " expected at least: -32768.0f : 32767.0f" << tcu::TestLog::EndMessage;
 
                        test_result = false;
                }