mirror of
https://github.com/reactos/reactos.git
synced 2024-11-02 04:37:32 +00:00
ff531eaade
Fix wrong behavior of shlwapi!StrDupA and shlwapi!StrDupW functions. JIRA issue: CORE-19495 Return NULL when lpszStr == NULL.
47 lines
884 B
C
47 lines
884 B
C
/*
|
|
* PROJECT: ReactOS api tests
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
* PURPOSE: Tests for StrDupA/W
|
|
* COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
|
|
*/
|
|
|
|
#include <apitest.h>
|
|
#include <shlwapi.h>
|
|
#include <versionhelpers.h>
|
|
|
|
static void TEST_StrDupA(void)
|
|
{
|
|
LPSTR ptrA;
|
|
|
|
ptrA = StrDupA(NULL);
|
|
|
|
if (IsWindowsXPOrGreater())
|
|
ok_ptr(ptrA, NULL);
|
|
else
|
|
ok(ptrA && !*ptrA, "ptrA: '%s'\n", wine_dbgstr_a(ptrA));
|
|
|
|
if (ptrA)
|
|
LocalFree(ptrA);
|
|
}
|
|
|
|
static void TEST_StrDupW(void)
|
|
{
|
|
LPWSTR ptrW;
|
|
|
|
ptrW = StrDupW(NULL);
|
|
|
|
if (IsWindowsXPOrGreater())
|
|
ok_ptr(ptrW, NULL);
|
|
else
|
|
ok(ptrW && !*ptrW, "ptrW: '%s'\n", wine_dbgstr_w(ptrW));
|
|
|
|
if (ptrW)
|
|
LocalFree(ptrW);
|
|
}
|
|
|
|
START_TEST(StrDup)
|
|
{
|
|
TEST_StrDupA();
|
|
TEST_StrDupW();
|
|
}
|