[Mesa-dev] [PATCH 7/9] dispatch_sanity test: allow newer functions to be set to NOP

Jordan Justen jordan.l.justen at intel.com
Wed Oct 24 14:20:09 PDT 2012


If a GL function was introduced in a later GL version than the
context we are testing, then it is okay if it is set to the
_mesa_generic_nop function.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/main/tests/dispatch_sanity.cpp |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index d27dd39..40b3d8e 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -111,6 +111,12 @@ DispatchSanity_test::validate_functions()
    _glapi_proc *table = (_glapi_proc *) ctx.Exec;
 
    for (unsigned i = 0; function_table[i].name != NULL; i++) {
+      /* The context version is >= the GL version where the
+         function was introduced. Therefore, the function cannot
+         be set to the nop function.
+       */
+      bool cant_be_nop = ctx.Version >= function_table[i].Version;
+
       const int offset = (function_table[i].offset != -1)
          ? function_table[i].offset
          : _glapi_get_proc_offset(function_table[i].name);
@@ -120,9 +126,11 @@ DispatchSanity_test::validate_functions()
       ASSERT_EQ(offset,
                 _glapi_get_proc_offset(function_table[i].name))
          << "Function: " << function_table[i].name;
-      EXPECT_NE((_glapi_proc) _mesa_generic_nop, table[offset])
-         << "Function: " << function_table[i].name
-         << " at offset " << offset;
+      if (cant_be_nop) {
+         EXPECT_NE((_glapi_proc) _mesa_generic_nop, table[offset])
+            << "Function: " << function_table[i].name
+            << " at offset " << offset;
+      }
 
       table[offset] = (_glapi_proc) _mesa_generic_nop;
    }
-- 
1.7.9.5



More information about the mesa-dev mailing list