From: Jeff Smith whydoubt@gmail.com
--- dlls/ddraw/tests/ddraw1.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 4cbab6eaee5..e350e071b94 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -15493,7 +15493,9 @@ static void test_pick(void)
set_execute_data(execute_buffer, 4, sizeof(tquad), inst_length);
- /* Perform a number of picks, we should have a specific amount by the end */ + /* Perform a number of picks, we should have a specific amount by the end. + * We should get precisely equal numbers of hits and no hits since our quad + * covers exactly half the screen. */ for (i = 0; i < screen_width; i += 80) { for (j = 0; j < screen_height; j += 60) @@ -15503,34 +15505,34 @@ static void test_pick(void)
hr = IDirect3DDevice_Pick(device, execute_buffer, viewport, 0, &pick_rect); ok(SUCCEEDED(hr), "Failed to perform pick, hr %#lx.\n", hr); + rec_count = ~0; hr = IDirect3DDevice_GetPickRecords(device, &rec_count, NULL); ok(SUCCEEDED(hr), "Failed to get pick records, hr %#lx.\n", hr); - if (rec_count > 0) - hits++; - else + if (rec_count == 0) nohits++; + else if (rec_count != ~0) + hits++; } }
- /* - We should have gotten precisely equal numbers of hits and no hits since our quad - covers exactly half the screen - */ - todo_wine ok(hits == nohits, "Got a non-equal amount of pick successes/failures: %i vs %i.\n", hits, nohits); + todo_wine ok(hits + nohits > 0, "Did not get any pick hits or misses.\n"); + ok(hits == nohits, "Got a non-equal amount of pick hits/misses: %i vs %i.\n", hits, nohits);
/* Try some specific pixel picks */ pick_rect.x1 = 480; pick_rect.y1 = 360; hr = IDirect3DDevice_Pick(device, execute_buffer, viewport, 0, &pick_rect); ok(SUCCEEDED(hr), "Failed to perform pick, hr %#lx.\n", hr); + rec_count = ~0; hr = IDirect3DDevice_GetPickRecords(device, &rec_count, NULL); ok(SUCCEEDED(hr), "Failed to get pick records, hr %#lx.\n", hr); - ok(rec_count == 0, "Got incorrect number of pick records (expected 0): %lu.\n", rec_count); + todo_wine ok(rec_count == 0, "Got incorrect number of pick records (expected 0): %lu.\n", rec_count);
pick_rect.x1 = 240; pick_rect.y1 = 120; hr = IDirect3DDevice_Pick(device, execute_buffer, viewport, 0, &pick_rect); ok(SUCCEEDED(hr), "Failed to perform pick, hr %#lx.\n", hr); + rec_count = ~0; hr = IDirect3DDevice_GetPickRecords(device, &rec_count, NULL); ok(SUCCEEDED(hr), "Failed to get pick records, hr %#lx.\n", hr); todo_wine ok(rec_count == 1, "Got incorrect number of pick records (expected 1): %lu.\n", rec_count);