ReactOS 0.4.16-dev-1983-g1a17364
_wcsnicmp.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Tests for _wcsnicmp
5 * COPYRIGHT: Copyright 2025 Timo Kreuzer (timo.kreuzer@reactos.org)
6 */
7
8#define WIN32_NO_STATUS
9#include <apitest.h>
10#include <pseh/pseh2.h>
11#include <ndk/umtypes.h>
12
13typedef int (__cdecl *PFN_wcsnicmp)(const wchar_t* _String1, const wchar_t* _String2, size_t _MaxCount);
15
16static BOOL Init(void)
17{
20 ok(p_wcsnicmp != NULL, "Failed to load _wcsnicmp from %s\n", TEST_DLL_NAME);
21 return (p_wcsnicmp != NULL);
22}
23
25{
26 int result;
27
28#ifndef TEST_STATIC_CRT
29 if (!Init())
30 {
31 skip("Skipping tests, because _wcsnicmp is not available\n");
32 return;
33 }
34#endif
35
36 StartSeh()
37 result = p_wcsnicmp(L"a", NULL, 0);
39
40 StartSeh()
41 result = p_wcsnicmp(L"a", NULL, 1);
43#ifdef TEST_NTDLL
45#else
47#endif
48
49 StartSeh()
50 result = p_wcsnicmp(NULL, L"a", 0);
52
53 StartSeh()
54 result = p_wcsnicmp(NULL, L"a", 1);
56#ifdef TEST_NTDLL
58#else
60#endif
61}
static BOOL Init(void)
Definition: _wcsnicmp.c:16
int(__cdecl * PFN_wcsnicmp)(const wchar_t *_String1, const wchar_t *_String2, size_t _MaxCount)
Definition: _wcsnicmp.c:13
static PFN_wcsnicmp p_wcsnicmp
Definition: _wcsnicmp.c:14
#define __cdecl
Definition: accygwin.h:79
#define GetNTVersion()
Definition: apitest.h:17
#define StartSeh()
Definition: apitest.h:93
#define EndSeh(ExpectedStatus)
Definition: apitest.h:99
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
_In_z_ wchar_t const * _String2
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define STATUS_ACCESS_VIOLATION
GLuint64EXT * result
Definition: glext.h:11304
#define TEST_DLL_NAME
Definition: wsprintf.c:3
_MaxCount
Definition: memory.h:72
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Definition: _wcsnicmp_nt.c:13
#define is_reactos()
Definition: test.h:1041
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
#define STATUS_SUCCESS
Definition: shellext.h:65
static PVOID hdll
Definition: shimdbg.c:126
#define MAXLONG
Definition: umtypes.h:116