Commit bc3ba2f0 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

opengl32/tests: Improve window destroy tests.

parent 1e0075cd
...@@ -949,6 +949,8 @@ static void test_destroy(HDC oldhdc) ...@@ -949,6 +949,8 @@ static void test_destroy(HDC oldhdc)
glFinish(); glFinish();
glerr = glGetError(); glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glClear, error %#x.\n", glerr); 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); ret = DestroyWindow(window);
ok(ret, "Failed to destroy window, last error %#x.\n", GetLastError()); ok(ret, "Failed to destroy window, last error %#x.\n", GetLastError());
...@@ -960,6 +962,10 @@ static void test_destroy(HDC oldhdc) ...@@ -960,6 +962,10 @@ static void test_destroy(HDC oldhdc)
err = GetLastError(); err = GetLastError();
ok(!ret && err == ERROR_INVALID_HANDLE, ok(!ret && err == ERROR_INVALID_HANDLE,
"Unexpected behavior when making context current, ret %d, last error %#x.\n", ret, err); "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"); ok(wglGetCurrentContext() == ctx, "Wrong current context.\n");
...@@ -967,6 +973,10 @@ static void test_destroy(HDC oldhdc) ...@@ -967,6 +973,10 @@ static void test_destroy(HDC oldhdc)
glFinish(); glFinish();
glerr = glGetError(); glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glClear, error %#x.\n", glerr); 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); ret = wglMakeCurrent(NULL, NULL);
ok(ret, "Failed to clear current context, last error %#x.\n", GetLastError()); ok(ret, "Failed to clear current context, last error %#x.\n", GetLastError());
...@@ -975,6 +985,10 @@ static void test_destroy(HDC oldhdc) ...@@ -975,6 +985,10 @@ static void test_destroy(HDC oldhdc)
glFinish(); glFinish();
glerr = glGetError(); glerr = glGetError();
todo_wine ok(glerr == GL_INVALID_OPERATION, "Failed glClear, error %#x.\n", glerr); 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); SetLastError(0xdeadbeef);
ret = wglMakeCurrent(dc, ctx); ret = wglMakeCurrent(dc, ctx);
...@@ -1087,6 +1101,8 @@ static void test_destroy_read(HDC oldhdc) ...@@ -1087,6 +1101,8 @@ static void test_destroy_read(HDC oldhdc)
glFinish(); glFinish();
glerr = glGetError(); glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glCopyPixel, error %#x.\n", glerr); 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); ret = DestroyWindow(read_window);
ok(ret, "Failed to destroy window, last error %#x.\n", GetLastError()); ok(ret, "Failed to destroy window, last error %#x.\n", GetLastError());
...@@ -1105,6 +1121,8 @@ static void test_destroy_read(HDC oldhdc) ...@@ -1105,6 +1121,8 @@ static void test_destroy_read(HDC oldhdc)
glFinish(); glFinish();
glerr = glGetError(); glerr = glGetError();
ok(glerr == GL_NO_ERROR, "Failed glClear, error %#x.\n", glerr); 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); ret = wglMakeCurrent(NULL, NULL);
ok(ret, "Failed to clear current context, last error %#x.\n", GetLastError()); ok(ret, "Failed to clear current context, last error %#x.\n", GetLastError());
...@@ -1125,6 +1143,10 @@ static void test_destroy_read(HDC oldhdc) ...@@ -1125,6 +1143,10 @@ static void test_destroy_read(HDC oldhdc)
glFinish(); glFinish();
glerr = glGetError(); glerr = glGetError();
todo_wine ok(glerr == GL_INVALID_OPERATION, "Failed glClear, error %#x.\n", glerr); 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); SetLastError(0xdeadbeef);
ret = pwglMakeContextCurrentARB(draw_dc, read_dc, ctx); ret = pwglMakeContextCurrentARB(draw_dc, read_dc, ctx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment