This allows figuring out which function the crash happens in when there is no backtrace. Just set WINETEST_NO_MT_D3D=1 WINETEST_DEBUG=2.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- The patch decodes the feature level before printing it but maybe that's presuming too much and a simple %04x would be better. --- dlls/d3d11/tests/d3d11.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index d412f430b60..29f8c7ce831 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -49,6 +49,7 @@ static struct test_entry void (*test)(void); void (*test_fl)(D3D_FEATURE_LEVEL fl); } u; + const char* name; D3D_FEATURE_LEVEL fl; } *mt_tests; size_t mt_tests_size, mt_test_count; @@ -121,21 +122,25 @@ static void queue_test_entry(const struct test_entry *t) mt_tests[mt_test_count++] = *t; }
-static void queue_test_fl(void (*test)(const D3D_FEATURE_LEVEL fl), D3D_FEATURE_LEVEL fl) +#define queue_test_fl(f,fl) _queue_test_fl(f,#f,fl) +static void _queue_test_fl(void (*test)(const D3D_FEATURE_LEVEL fl), const char* name, D3D_FEATURE_LEVEL fl) { struct test_entry t;
t.u.test_fl = test; t.fl = fl; + t.name = name; queue_test_entry(&t); }
-static void queue_test(void (*test)(void)) +#define queue_test(f) _queue_test(f,#f) +static void _queue_test(void (*test)(void), const char* name) { struct test_entry t;
t.u.test = test; t.fl = 0; + t.name = name; queue_test_entry(&t); }
@@ -172,6 +177,7 @@ static void run_queued_tests(void) { for (i = 0; i < mt_test_count; ++i) { + trace("fl=%d.%d %s\n", mt_tests[i].fl >> 12, (mt_tests[i].fl >> 8) & 0xf, mt_tests[i].name); run_mt_test(&mt_tests[i]); }
@@ -20452,8 +20458,10 @@ static void test_fl9_draw(const D3D_FEATURE_LEVEL feature_level) release_test_context(&test_context); }
-static void queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL begin, - D3D_FEATURE_LEVEL end, void (*test_func)(const D3D_FEATURE_LEVEL fl)) +#define queue_for_each_feature_level_in_range(b,e,f) _queue_for_each_feature_level_in_range(b,e,f,#f) +static void _queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL begin, + D3D_FEATURE_LEVEL end, void (*test_func)(const D3D_FEATURE_LEVEL fl), + const char* name) { static const D3D_FEATURE_LEVEL feature_levels[] = { @@ -20471,20 +20479,24 @@ static void queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL begin, for (i = 0; i < ARRAY_SIZE(feature_levels); ++i) { if (begin <= feature_levels[i] && feature_levels[i] <= end) - queue_test_fl(test_func, feature_levels[i]); + _queue_test_fl(test_func, name, feature_levels[i]); } }
-static void queue_for_each_feature_level(void (*test_func)(const D3D_FEATURE_LEVEL fl)) +#define queue_for_each_feature_level(f) _queue_for_each_feature_level(f,#f) +static void _queue_for_each_feature_level(void (*test_func)(const D3D_FEATURE_LEVEL fl), + const char* name) { - queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL_9_1, - D3D_FEATURE_LEVEL_11_1, test_func); + _queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL_9_1, + D3D_FEATURE_LEVEL_11_1, test_func, name); }
-static void queue_for_each_9_x_feature_level(void (*test_func)(const D3D_FEATURE_LEVEL fl)) +#define queue_for_each_9_x_feature_level(f) _queue_for_each_9_x_feature_level(f,#f) +static void _queue_for_each_9_x_feature_level(void (*test_func)(const D3D_FEATURE_LEVEL fl), + const char* name) { - queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL_9_1, - D3D_FEATURE_LEVEL_9_3, test_func); + _queue_for_each_feature_level_in_range(D3D_FEATURE_LEVEL_9_1, + D3D_FEATURE_LEVEL_9_3, test_func, name); }
static void test_ddy(void)