1 /* 2 * PROJECT: ReactOS api tests 3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4 * PURPOSE: Tests for StrDupA/W 5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> 6 */ 7 8 #include <apitest.h> 9 #include <shlwapi.h> 10 #include <versionhelpers.h> 11 12 static void TEST_StrDupA(void) 13 { 14 LPSTR ptrA; 15 16 ptrA = StrDupA(NULL); 17 18 if (IsWindowsXPOrGreater()) 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 } 26 27 static void TEST_StrDupW(void) 28 { 29 LPWSTR ptrW; 30 31 ptrW = StrDupW(NULL); 32 33 if (IsWindowsXPOrGreater()) 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 } 41 42 START_TEST(StrDup) 43 { 44 TEST_StrDupA(); 45 TEST_StrDupW(); 46 } 47