Matteo Bruni : opengl32/tests: Improve window destroy tests.
Alexandre Julliard
julliard at winehq.org
Thu Mar 31 12:43:44 CDT 2011
Module: wine
Branch: master
Commit: bc3ba2f06e4ce34177ac60dc4a48b6c39470d6e7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bc3ba2f06e4ce34177ac60dc4a48b6c39470d6e7
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Mon Mar 14 14:47:25 2011 +0100
opengl32/tests: Improve window destroy tests.
---
dlls/opengl32/tests/opengl.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index 1669d73..64b9ee5 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -949,6 +949,8 @@ static void test_destroy(HDC oldhdc)
glFinish();
glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glClear, error %#x.\n", glerr);
+ ret = SwapBuffers(dc);
+ ok(ret, "Failed SwapBuffers, error %#x.\n", GetLastError());
ret = DestroyWindow(window);
ok(ret, "Failed to destroy window, last error %#x.\n", GetLastError());
@@ -960,6 +962,10 @@ static void test_destroy(HDC oldhdc)
err = GetLastError();
ok(!ret && err == ERROR_INVALID_HANDLE,
"Unexpected behavior when making context current, ret %d, last error %#x.\n", ret, err);
+ SetLastError(0xdeadbeef);
+ ret = SwapBuffers(dc);
+ err = GetLastError();
+ ok(!ret && err == ERROR_INVALID_HANDLE, "Unexpected behavior with SwapBuffer, last error %#x.\n", err);
ok(wglGetCurrentContext() == ctx, "Wrong current context.\n");
@@ -967,6 +973,10 @@ static void test_destroy(HDC oldhdc)
glFinish();
glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glClear, error %#x.\n", glerr);
+ SetLastError(0xdeadbeef);
+ ret = SwapBuffers(dc);
+ err = GetLastError();
+ ok(!ret && err == ERROR_INVALID_HANDLE, "Unexpected behavior with SwapBuffer, last error %#x.\n", err);
ret = wglMakeCurrent(NULL, NULL);
ok(ret, "Failed to clear current context, last error %#x.\n", GetLastError());
@@ -975,6 +985,10 @@ static void test_destroy(HDC oldhdc)
glFinish();
glerr = glGetError();
todo_wine ok(glerr == GL_INVALID_OPERATION, "Failed glClear, error %#x.\n", glerr);
+ SetLastError(0xdeadbeef);
+ ret = SwapBuffers(dc);
+ err = GetLastError();
+ ok(!ret && err == ERROR_INVALID_HANDLE, "Unexpected behavior with SwapBuffer, last error %#x.\n", err);
SetLastError(0xdeadbeef);
ret = wglMakeCurrent(dc, ctx);
@@ -1087,6 +1101,8 @@ static void test_destroy_read(HDC oldhdc)
glFinish();
glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glCopyPixel, error %#x.\n", glerr);
+ ret = SwapBuffers(draw_dc);
+ ok(ret, "Failed SwapBuffers, error %#x.\n", GetLastError());
ret = DestroyWindow(read_window);
ok(ret, "Failed to destroy window, last error %#x.\n", GetLastError());
@@ -1105,6 +1121,8 @@ static void test_destroy_read(HDC oldhdc)
glFinish();
glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glClear, error %#x.\n", glerr);
+ ret = SwapBuffers(draw_dc);
+ ok(ret, "Failed SwapBuffers, error %#x.\n", GetLastError());
ret = wglMakeCurrent(NULL, NULL);
ok(ret, "Failed to clear current context, last error %#x.\n", GetLastError());
@@ -1125,6 +1143,10 @@ static void test_destroy_read(HDC oldhdc)
glFinish();
glerr = glGetError();
todo_wine ok(glerr == GL_INVALID_OPERATION, "Failed glClear, error %#x.\n", glerr);
+ SetLastError(0xdeadbeef);
+ ret = SwapBuffers(draw_dc);
+ err = GetLastError();
+ ok(!ret && err == ERROR_INVALID_HANDLE, "Unexpected behavior with SwapBuffer, last error %#x.\n", err);
SetLastError(0xdeadbeef);
ret = pwglMakeContextCurrentARB(draw_dc, read_dc, ctx);
More information about the wine-cvs
mailing list