Author: jimtabor Date: Mon Jan 5 22:25:48 2015 New Revision: 65989
URL: http://svn.reactos.org/svn/reactos?rev=65989&view=rev Log: [ApiTest] - Add a test for sequential list of control atoms. This is an addition to the Real Classes tests.
Modified: trunk/rostests/apitests/user32/RealGetWindowClass.c
Modified: trunk/rostests/apitests/user32/RealGetWindowClass.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/RealGetWin... ============================================================================== --- trunk/rostests/apitests/user32/RealGetWindowClass.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/RealGetWindowClass.c [iso-8859-1] Mon Jan 5 22:25:48 2015 @@ -11,6 +11,27 @@ #include <winuser.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + +static PWSTR ControlsList[] = +{ + L"Button\0", + L"Edit\0", + L"Static\0", + L"ListBox\0", + L"ScrollBar\0", + L"ComboBox\0", + L"MDIClient\0", + L"ComboLBox\0", + L"DDEMLEvent\0", + L"DDEMLMom\0", + L"DMGClass\0", + L"DDEMLAnsiClient\0", + L"DDEMLUnicodeClient\0", + L"DDEMLAnsiServer\0", + L"DDEMLUnicodeServer\0", + L"IME\0", + L"\0",//L"Ghost\0", // Vista+, Ghost is registered after "Message" in XP/W2k3 Win32k.sys. +};
typedef struct _TestData { @@ -57,6 +78,41 @@ "N/A", }, }; + +// +// The Control Class Atoms are consecitively issued. +// + +void Test_ClassAtoms() +{ + ATOM atom; + int i; + WNDCLASSW cls; + + // Initialize starting Atom number. + atom = GetClassInfoW(NULL, ControlsList[0], &cls); + if (!atom) + { + skip( "No reference Atom\n" ); + return; + } + + trace("First Control Class Atom 0x%x\n",atom); + + for (i = 0; i < 17; atom++ ,i++) + { + if (lstrcmpW(ControlsList[i],L"\0")) + { + ATOM test_atom = GetClassInfoW(NULL, ControlsList[i], &cls); + // Skip unregistered Classes. + if (test_atom) + { + ok(test_atom == atom, "%S class atom did not match %x:%x\n",ControlsList[i],test_atom,atom); + ok(!lstrcmpW(cls.lpszClassName,ControlsList[i]),"GetClassName returned incorrect name\n"); + } + } + } +}
void Test_RealGetWindowClass() { @@ -130,6 +186,7 @@
START_TEST(RealGetWindowClass) { + Test_ClassAtoms(); Test_RealGetWindowClass(); }