Skip to content

Commit 21abf31

Browse files
committed
windows.cfg: Added a regression test for GetPrivateProfileString() as we had a FP in the past danmar@8b6c14a
1 parent 27d7609 commit 21abf31

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/cfg/windows.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,28 @@ void invalidFunctionArg__getcwd(char * buffer)
8787
}
8888
free(buffer);
8989
}
90+
// DWORD GetPrivateProfileString(
91+
// [in] LPCTSTR lpAppName,
92+
// [in] LPCTSTR lpKeyName,
93+
// [in] LPCTSTR lpDefault,
94+
// [out] LPTSTR lpReturnedString,
95+
// [in] DWORD nSize,
96+
// [in] LPCTSTR lpFileName)
97+
void nullPointer_GetPrivateProfileString(LPCTSTR lpAppName,
98+
LPCTSTR lpKeyName,
99+
LPCTSTR lpDefault,
100+
LPTSTR lpReturnedString,
101+
DWORD nSize,
102+
LPCTSTR lpFileName)
103+
{
104+
// No warning is expected
105+
(void)GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpReturnedString, nSize, lpFileName);
106+
107+
// No warning is expected for 1st arg as nullptr
108+
(void)GetPrivateProfileString(nullptr, lpKeyName, lpDefault, lpReturnedString, nSize, lpFileName);
109+
// No warning is expected for 2st arg as nullptr
110+
(void)GetPrivateProfileString(lpAppName, nullptr, lpDefault, lpReturnedString, nSize, lpFileName);
111+
}
90112

91113
void nullPointer__get_timezone(long *sec)
92114
{

0 commit comments

Comments
 (0)