mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
[APPHELP][APPHELP_APITEST] Add SdbTagToString + test by Mislav Blažević CORE-10367
svn path=/trunk/; revision=71197
This commit is contained in:
parent
84690a71d8
commit
7aaa9aee54
6 changed files with 547 additions and 1 deletions
|
@ -3,6 +3,7 @@ add_definitions(-D__ROS_LONG64__)
|
|||
|
||||
list(APPEND SOURCE
|
||||
layerapi.c
|
||||
apphelp.c
|
||||
testlist.c)
|
||||
|
||||
add_executable(apphelp_apitest ${SOURCE})
|
||||
|
|
81
rostests/apitests/apphelp/apphelp.c
Normal file
81
rostests/apitests/apphelp/apphelp.c
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright 2012 Detlef Riekenberg
|
||||
* Copyright 2013 Mislav Blaževic
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#include <ntstatus.h>
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#include <shlwapi.h>
|
||||
#include <winnt.h>
|
||||
#ifdef __REACTOS__
|
||||
#include <ntndk.h>
|
||||
#else
|
||||
#include <winternl.h>
|
||||
#endif
|
||||
|
||||
#include <winerror.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
|
||||
typedef WORD TAG;
|
||||
|
||||
#define TAG_TYPE_MASK 0xF000
|
||||
|
||||
#define TAG_TYPE_NULL 0x1000
|
||||
#define TAG_TYPE_BYTE 0x2000
|
||||
#define TAG_TYPE_WORD 0x3000
|
||||
#define TAG_TYPE_DWORD 0x4000
|
||||
#define TAG_TYPE_QWORD 0x5000
|
||||
#define TAG_TYPE_STRINGREF 0x6000
|
||||
#define TAG_TYPE_LIST 0x7000
|
||||
#define TAG_TYPE_STRING 0x8000
|
||||
#define TAG_TYPE_BINARY 0x9000
|
||||
|
||||
|
||||
static HMODULE hdll;
|
||||
static LPCWSTR (WINAPI *pSdbTagToString)(TAG);
|
||||
|
||||
static void test_SdbTagToString(void)
|
||||
{
|
||||
static const TAG invalid_values[] = {
|
||||
1, TAG_TYPE_WORD, TAG_TYPE_MASK,
|
||||
TAG_TYPE_DWORD | 0xFF,
|
||||
TAG_TYPE_DWORD | (0x800 + 0xEE),
|
||||
0x900, 0xFFFF, 0xDEAD, 0xBEEF
|
||||
};
|
||||
static const WCHAR invalid[] = {'I','n','v','a','l','i','d','T','a','g',0};
|
||||
LPCWSTR ret;
|
||||
WORD i;
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
ret = pSdbTagToString(invalid_values[i]);
|
||||
ok(lstrcmpW(ret, invalid) == 0, "unexpected string %s, should be %s\n",
|
||||
wine_dbgstr_w(ret), wine_dbgstr_w(invalid));
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST(apphelp)
|
||||
{
|
||||
hdll = LoadLibraryA("apphelp.dll");
|
||||
pSdbTagToString = (void *) GetProcAddress(hdll, "SdbTagToString");
|
||||
test_SdbTagToString();
|
||||
}
|
|
@ -4,9 +4,11 @@
|
|||
#include <wine/test.h>
|
||||
|
||||
extern void func_layerapi(void);
|
||||
extern void func_apphelp(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "layerapi", func_layerapi },
|
||||
{ "apphelp", func_apphelp },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue