Skip to content

Commit a75ecbc

Browse files
committed
std.cfg: Improved tests for wcsftime().
1 parent 5d26d62 commit a75ecbc

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

test/cfg/std.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,17 @@ void nullpointer(int value)
381381
wscanf(L"%i", NULL);
382382
}
383383

384+
void nullPointer_wcsftime(wchar_t* ptr, size_t maxsize, const wchar_t* format, const struct tm* timeptr)
385+
{
386+
// cppcheck-suppress nullPointer
387+
(void)wcsftime(NULL, maxsize, format, timeptr);
388+
// cppcheck-suppress nullPointer
389+
(void)wcsftime(ptr, maxsize, NULL, timeptr);
390+
// cppcheck-suppress nullPointer
391+
(void)wcsftime(ptr, maxsize, format, NULL);
392+
(void)wcsftime(ptr, maxsize, format, timeptr);
393+
}
394+
384395
int nullPointer_wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n)
385396
{
386397
// cppcheck-suppress nullPointer
@@ -4575,17 +4586,6 @@ void nullPointer_asctime_s(void)
45754586
asctime_s(1, 26, tm);
45764587
}
45774588

4578-
void nullPointer_wcsftime(size_t maxsize)
4579-
{
4580-
wchar_t* ptr = 0;
4581-
wchar_t* format = 0;
4582-
struct tm* timeptr = 0;
4583-
// cppcheck-suppress nullPointer
4584-
(void)wcsftime(ptr,maxsize,format,timeptr);
4585-
// cppcheck-suppress nullPointer
4586-
(void)wcsftime(0,maxsize,0,0);
4587-
}
4588-
45894589
void nullPointer_fegetenv(void)
45904590
{
45914591
fenv_t* envp = 0;

test/cfg/std.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,15 +3545,15 @@ void nullPointer_asctime(void)
35453545
(void)std::asctime(0);
35463546
}
35473547

3548-
void nullPointer_wcsftime(size_t maxsize)
3548+
void nullPointer_wcsftime(wchar_t* ptr, size_t maxsize, const wchar_t* format, const struct tm* timeptr)
35493549
{
3550-
wchar_t* ptr = 0;
3551-
wchar_t* format = 0;
3552-
struct tm* timeptr = 0;
35533550
// cppcheck-suppress nullPointer
3554-
(void)std::wcsftime(ptr,maxsize,format,timeptr);
3551+
(void)std::wcsftime(NULL, maxsize, format, timeptr);
35553552
// cppcheck-suppress nullPointer
3556-
(void)std::wcsftime(0,maxsize,0,0);
3553+
(void)std::wcsftime(ptr, maxsize, NULL, timeptr);
3554+
// cppcheck-suppress nullPointer
3555+
(void)std::wcsftime(ptr, maxsize, format, NULL);
3556+
(void)std::wcsftime(ptr, maxsize, format, timeptr);
35573557
}
35583558

35593559
void nullPointer_fegetenv(void)

0 commit comments

Comments
 (0)