mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 18:53:05 +00:00
[SHLWAPI][SHLWAPI_APITEST] Optimize StrRetToStrW WSTR handling (#7513)
This avoids Alloc/Free while also matching the Windows behavior.
This commit is contained in:
parent
e3c859ed96
commit
4d0a26db58
2 changed files with 23 additions and 0 deletions
|
@ -39,8 +39,25 @@ static void TEST_StrDupW(void)
|
|||
LocalFree(ptrW);
|
||||
}
|
||||
|
||||
static void TEST_StrRet(void)
|
||||
{
|
||||
LPWSTR input, output;
|
||||
if (SUCCEEDED(SHStrDupW(L"Test", &input)))
|
||||
{
|
||||
STRRET strret;
|
||||
strret.uType = STRRET_WSTR;
|
||||
U(strret).pOleStr = input;
|
||||
output = NULL;
|
||||
ok_int(StrRetToStrW(&strret, NULL, &output), S_OK);
|
||||
ok_ptr(U(strret).pOleStr, NULL);
|
||||
ok_ptr(input, output);
|
||||
CoTaskMemFree(output);
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST(StrDup)
|
||||
{
|
||||
TEST_StrDupA();
|
||||
TEST_StrDupW();
|
||||
TEST_StrRet();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue