From: Jacob Czekalla jczekalla@codeweavers.com
--- dlls/comctl32/tests/progress.c | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c index b6716366498..5211dff3065 100644 --- a/dlls/comctl32/tests/progress.c +++ b/dlls/comctl32/tests/progress.c @@ -308,6 +308,44 @@ static void test_PBM_STEPIT(void) } }
+void test_bar_states(void) +{ + HWND progress_bar; + int state; + + progress_bar = create_progress(0); + + /* Check for normal state */ + state = SendMessageA(progress_bar, PBM_GETSTATE, 0, 0); + ok(state == PBST_NORMAL, "Expected %d (PBST_NORMAL), but got %d.\n", PBST_NORMAL, state); + + /* Check for paused state */ + state = SendMessageA(progress_bar, PBM_SETSTATE, PBST_PAUSED, 0); + ok(state == PBST_NORMAL, "Expected %d (PBST_NORMAL), but got %d\n", PBST_NORMAL, state); + state = SendMessageA(progress_bar, PBM_GETSTATE, 0, 0); + todo_wine ok(state == PBST_PAUSED, "Expected %d (PBST_PAUSED), but got %d\n", PBST_PAUSED, state); + + /* Check for error state */ + state = SendMessageA(progress_bar, PBM_SETSTATE, PBST_ERROR, 0); + todo_wine ok(state == PBST_PAUSED, "Expected %d (PBST_PAUSED), but got %d\n", PBST_PAUSED, state); + state = SendMessageA(progress_bar, PBM_GETSTATE, 0, 0); + todo_wine ok(state == PBST_ERROR, "Expected %d (PBST_ERROR), but got %d\n", PBST_ERROR, state); + + /* Check bad state */ + state = SendMessageA(progress_bar, PBM_SETSTATE, 0, 0); + todo_wine ok(state == 0, "Expected 0, but got %d\n", state); + state = SendMessageA(progress_bar, PBM_GETSTATE, 0, 0); + todo_wine ok(state == PBST_ERROR, "Expected %d (PBST_ERROR), but got %d\n", PBST_ERROR, state); + + /* Check setting current state */ + state = SendMessageA(progress_bar, PBM_SETSTATE, PBST_ERROR, 0); + todo_wine ok(state == PBST_ERROR, "Expected %d (PBST_ERROR), but got %d\n", PBST_ERROR, state); + state = SendMessageA(progress_bar, PBM_GETSTATE, 0, 0); + todo_wine ok(state == PBST_ERROR, "Expected %d (PBST_ERROR), but got %d\n", PBST_ERROR, state); + + DestroyWindow(progress_bar); +} + static void init_functions(void) { HMODULE hComCtl32 = LoadLibraryA("comctl32.dll"); @@ -340,6 +378,7 @@ START_TEST(progress)
test_setcolors(); test_PBM_STEPIT(); + test_bar_states();
unload_v6_module(ctx_cookie, hCtx);