Author: gadamopoulos Date: Mon Jun 5 14:25:37 2017 New Revision: 74923
URL: http://svn.reactos.org/svn/reactos?rev=74923&view=rev Log: [COMCTL32_APITEST] -Add tests for CCM_GETVERSION and CCM_SETVERSION for the v5 and v6 toolbar control.
Added: trunk/rostests/apitests/comctl32/comctl32v5.manifest (with props) trunk/rostests/apitests/comctl32/toolbar.c (with props) Modified: trunk/rostests/apitests/comctl32/CMakeLists.txt trunk/rostests/apitests/comctl32/testlist.c
Modified: trunk/rostests/apitests/comctl32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/CMakeLis... ============================================================================== --- trunk/rostests/apitests/comctl32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/comctl32/CMakeLists.txt [iso-8859-1] Mon Jun 5 14:25:37 2017 @@ -1,6 +1,7 @@
-add_executable(comctl32_apitest button.c testlist.c ../include/msgtrace.c comctl32_apitest.rc) +add_executable(comctl32_apitest button.c toolbar.c testlist.c ../include/msgtrace.c comctl32_apitest.rc) target_link_libraries(comctl32_apitest wine) set_module_type(comctl32_apitest win32cui) add_importlibs(comctl32_apitest uxtheme comctl32 user32 gdi32 msvcrt kernel32 ntdll) add_rostests_file(TARGET comctl32_apitest) +add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/comctl32v5.manifest")
Added: trunk/rostests/apitests/comctl32/comctl32v5.manifest URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/comctl32... ============================================================================== --- trunk/rostests/apitests/comctl32/comctl32v5.manifest (added) +++ trunk/rostests/apitests/comctl32/comctl32v5.manifest [iso-8859-1] Mon Jun 5 14:25:37 2017 @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + publicKeyToken="6595b64144ccf1df" + processorArchitecture="*" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly>
Propchange: trunk/rostests/apitests/comctl32/comctl32v5.manifest ------------------------------------------------------------------------------ svn:eol-style = CRLF
Modified: trunk/rostests/apitests/comctl32/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/testlist... ============================================================================== --- trunk/rostests/apitests/comctl32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/comctl32/testlist.c [iso-8859-1] Mon Jun 5 14:25:37 2017 @@ -2,9 +2,11 @@ #include <apitest.h>
extern void func_button(void); +extern void func_toolbar(void);
const struct test winetest_testlist[] = { { "buttonv6", func_button }, + { "toolbarv6", func_toolbar }, { 0, 0 } };
Added: trunk/rostests/apitests/comctl32/toolbar.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/toolbar.... ============================================================================== --- trunk/rostests/apitests/comctl32/toolbar.c (added) +++ trunk/rostests/apitests/comctl32/toolbar.c [iso-8859-1] Mon Jun 5 14:25:37 2017 @@ -0,0 +1,123 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for toolbar window class v6 + * PROGRAMMERS: Giannis Adamopoulos + */ + +#include "wine/test.h" +#include <stdio.h> +#include <windows.h> +#include <commctrl.h> +#include <uxtheme.h> +#include <undocuser.h> +#include <msgtrace.h> +#include <user32testhelpers.h> + +HANDLE _CreateV5ActCtx() +{ + ACTCTXW ActCtx = {sizeof(ACTCTX)}; + WCHAR buffer[MAX_PATH] , *separator; + + ok (GetModuleFileNameW(NULL, buffer, MAX_PATH), "GetModuleFileName failed\n"); + separator = wcsrchr(buffer, L'\'); + if (separator) + wcscpy(separator + 1, L"comctl32v5.manifest"); + + ActCtx.lpSource = buffer; + + return CreateActCtxW(&ActCtx);; +} + + +void TestVersionMessage() +{ + HWND hwnd; + int version; + + hwnd = CreateWindowExW(0, TOOLBARCLASSNAMEW, L"Test", 0, 0, 0, 0, 0, 0, 0, 0, NULL); + ok(hwnd != NULL, "CreateWindowEx failed\n"); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 5, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 7, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 4, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 6, "Got %d, expected 6\n", version); + + DestroyWindow(hwnd); +} + +void TestV5VersionMessage() +{ + HWND hwnd; + int version; + + hwnd = CreateWindowExW(0, TOOLBARCLASSNAMEW, L"Test", 0, 0, 0, 0, 0, 0, 0, 0, NULL); + ok(hwnd != NULL, "CreateWindowEx failed\n"); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 0, "Got %d, expected 0\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 6, 0); + ok(version == -1, "Got %d, expected -1\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 7, 0); + ok(version == -1, "Got %d, expected -1\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 5, 0); + ok(version == 0, "Got %d, expected -1\n", version); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 5, "Got %d, expected 5\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 4, 0); + ok(version == 5, "Got %d, expected -1\n", version); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 4, "Got %d, expected 5\n", version); + + version = SendMessageW(hwnd, CCM_SETVERSION, 3, 0); + ok(version == 4, "Got %d, expected -1\n", version); + + version = SendMessageW(hwnd, CCM_GETVERSION, 0, 0); + ok(version == 3, "Got %d, expected 5\n", version); + + DestroyWindow(hwnd); +} + +START_TEST(toolbar) +{ + HANDLE hV5ActCtx; + + LoadLibraryW(L"comctl32.dll"); + + TestVersionMessage(); + + hV5ActCtx = _CreateV5ActCtx(); + ok (hV5ActCtx != INVALID_HANDLE_VALUE, ""); + if (hV5ActCtx) + { + ULONG_PTR cookie; + BOOL bActivated = ActivateActCtx(hV5ActCtx, &cookie); + if (bActivated) + { + TestV5VersionMessage(); + DeactivateActCtx(0, cookie); + } + } +}
Propchange: trunk/rostests/apitests/comctl32/toolbar.c ------------------------------------------------------------------------------ svn:eol-style = native