ReactOS 0.4.16-dev-533-gc7d1aa3
StrDup.c File Reference
#include <apitest.h>
#include <shlwapi.h>
#include <versionhelpers.h>
Include dependency graph for StrDup.c:

Go to the source code of this file.

Functions

static void TEST_StrDupA (void)
 
static void TEST_StrDupW (void)
 
static void TEST_StrRet (void)
 
 START_TEST (StrDup)
 

Function Documentation

◆ START_TEST()

START_TEST ( StrDup  )

Definition at line 58 of file StrDup.c.

59{
63}
static void TEST_StrDupA(void)
Definition: StrDup.c:12
static void TEST_StrRet(void)
Definition: StrDup.c:42
static void TEST_StrDupW(void)
Definition: StrDup.c:27

◆ TEST_StrDupA()

static void TEST_StrDupA ( void  )
static

Definition at line 12 of file StrDup.c.

13{
14 LPSTR ptrA;
15
16 ptrA = StrDupA(NULL);
17
19 ok_ptr(ptrA, NULL);
20 else
21 ok(ptrA && !*ptrA, "ptrA: '%s'\n", wine_dbgstr_a(ptrA));
22
23 if (ptrA)
24 LocalFree(ptrA);
25}
#define ok(value,...)
Definition: atltest.h:57
#define ok_ptr(expression, result)
Definition: atltest.h:108
#define NULL
Definition: types.h:112
LPSTR WINAPI StrDupA(LPCSTR lpszStr)
Definition: string.c:1064
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:187
VERSIONHELPERAPI IsWindowsXPOrGreater()
char * LPSTR
Definition: xmlstorage.h:182

Referenced by START_TEST().

◆ TEST_StrDupW()

static void TEST_StrDupW ( void  )
static

Definition at line 27 of file StrDup.c.

28{
29 LPWSTR ptrW;
30
31 ptrW = StrDupW(NULL);
32
34 ok_ptr(ptrW, NULL);
35 else
36 ok(ptrW && !*ptrW, "ptrW: '%s'\n", wine_dbgstr_w(ptrW));
37
38 if (ptrW)
39 LocalFree(ptrW);
40}
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1093
#define wine_dbgstr_w
Definition: kernel32.h:34
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by START_TEST().

◆ TEST_StrRet()

static void TEST_StrRet ( void  )
static

Definition at line 42 of file StrDup.c.

43{
44 LPWSTR input, output;
45 if (SUCCEEDED(SHStrDupW(L"Test", &input)))
46 {
47 STRRET strret;
48 strret.uType = STRRET_WSTR;
49 U(strret).pOleStr = input;
50 output = NULL;
51 ok_int(StrRetToStrW(&strret, NULL, &output), S_OK);
52 ok_ptr(U(strret).pOleStr, NULL);
53 ok_ptr(input, output);
54 CoTaskMemFree(output);
55 }
56}
#define ok_int(expression, result)
Definition: atltest.h:134
#define U(x)
Definition: wordpad.c:45
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
Definition: string.c:1631
GLenum GLenum GLenum input
Definition: glext.h:9031
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define L(x)
Definition: ntvdm.h:50
@ STRRET_WSTR
Definition: shtypes.idl:85
UINT uType
Definition: shtypes.idl:93

Referenced by START_TEST().