dispatch_sanity: print names of functions that shouldnt be in dispatch table.
authorPaul Berry <stereotype441@gmail.com>
Tue, 23 Oct 2012 17:59:44 +0000 (10:59 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 25 Oct 2012 21:23:01 +0000 (14:23 -0700)
Previously we just printed the dispatch table index and the user had
to convert it to a function name.  That was a pain because when
FEATURE_remap_table is defined, the assignment of functions to
dispatch table entries is done at run time.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/tests/dispatch_sanity.cpp

index dbca5810437d937f67bab0a941eb517cdbe6354e..ee53d2e69d8f16a9a81988b3a4f1df68ddcb56dd 100644 (file)
@@ -100,6 +100,13 @@ DispatchSanity_test::SetUp()
    _mesa_init_driver_functions(&driver_functions);
 }
 
+static const char *
+offset_to_proc_name_safe(unsigned offset)
+{
+   const char *name = _glapi_get_proc_name(offset);
+   return name ? name : "???";
+}
+
 static void
 validate_functions(_glapi_proc *table, const struct function *function_table)
 {
@@ -122,7 +129,8 @@ validate_functions(_glapi_proc *table, const struct function *function_table)
 
    const unsigned size = _glapi_get_dispatch_table_size();
    for (unsigned i = 0; i < size; i++) {
-      EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i]) << "i = " << i;
+      EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i])
+         << "i = " << i << " (" << offset_to_proc_name_safe(i) << ")";
    }
 }