ReactOS 0.4.16-dev-329-g9223134
She.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Test for She* functions
5 * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "shelltest.h"
9#include <undocshell.h>
10
13
16
17static void test_SheRemoveQuotesA(void)
18{
19 CHAR sz0[] = "A\"Test\"";
20 CHAR sz1[] = "\"Test\"";
21 CHAR sz2[] = "\"Test\"123";
22
25 {
27 }
29 {
31 }
34
35 ok_ptr(pSheRemoveQuotesA(sz0), sz0);
36 ok_str(sz0, "A\"Test\"");
37
38 ok_ptr(pSheRemoveQuotesA(sz1), sz1);
39 ok_str(sz1, "Test");
40
41 ok_ptr(pSheRemoveQuotesA(sz2), sz2);
42 ok_str(sz2, "Test");
43}
44
45static void test_SheRemoveQuotesW(void)
46{
47 WCHAR sz0[] = L"A\"Test\"";
48 WCHAR sz1[] = L"\"Test\"";
49 WCHAR sz2[] = L"\"Test\"123";
50
53 {
55 }
57 {
59 }
62
63 ok_ptr(pSheRemoveQuotesW(sz0), sz0);
64 ok_wstr(sz0, L"A\"Test\"");
65
66 ok_ptr(pSheRemoveQuotesW(sz1), sz1);
67 ok_wstr(sz1, L"Test");
68
69 ok_ptr(pSheRemoveQuotesW(sz2), sz2);
70 ok_wstr(sz2, L"Test");
71}
72
74{
78
80 {
81 skip("SheRemoveQuotes not found");
82 return;
83 }
84
87}
BOOL bGotException
static void test_SheRemoveQuotesA(void)
Definition: She.cpp:17
static FN_SheRemoveQuotesA pSheRemoveQuotesA
Definition: She.cpp:14
LPWSTR(WINAPI * FN_SheRemoveQuotesW)(LPWSTR psz)
Definition: She.cpp:12
LPSTR(WINAPI * FN_SheRemoveQuotesA)(LPSTR psz)
Definition: She.cpp:11
static void test_SheRemoveQuotesW(void)
Definition: She.cpp:45
static FN_SheRemoveQuotesW pSheRemoveQuotesW
Definition: She.cpp:15
#define ok_str(x, y)
Definition: atltest.h:127
#define skip(...)
Definition: atltest.h:64
#define ok_wstr(x, y)
Definition: atltest.h:130
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define ok_ptr(expression, result)
Definition: atltest.h:108
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
static HMODULE hShell32
Definition: string.c:34
#define L(x)
Definition: ntvdm.h:50
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define WINAPI
Definition: msvc.h:6
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175