std.cfg: Added more tests for memcmp(), memcpy() and memmove().

This commit is contained in:
orbitcowboy 2022-04-21 21:01:38 +02:00
parent 3feecc51d6
commit 1bf7b3b7dd
2 changed files with 51 additions and 8 deletions

View File

@ -408,12 +408,6 @@ void nullPointer_memchr(char *p)
(void)p;
}
void nullPointer_memcmp(char *p)
{
// cppcheck-suppress nullPointer
(void)memcmp(p, 0, 123);
}
void nullPointer_vsnprintf(const char * format, ...)
{
va_list args;
@ -3670,6 +3664,33 @@ void nullPointer_wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n)
(void)wmemcmp(s1,s2,n);
}
void nullPointer_memmove(void *s1, void *s2, size_t n)
{
// cppcheck-suppress nullPointer
(void)memmove(NULL,s2,n);
// cppcheck-suppress nullPointer
(void)memmove(s1,NULL,n);
(void)memmove(s1,s2,n);
}
void nullPointer_memcmp(const void *s1, const void *s2, size_t n)
{
// cppcheck-suppress nullPointer
(void)memcmp(NULL,s2,n);
// cppcheck-suppress nullPointer
(void)memcmp(s1,NULL,n);
(void)memcmp(s1,s2,n);
}
void nullPointer_memcpy(void *s1, const void *s2, size_t n)
{
// cppcheck-suppress nullPointer
(void)memcpy(NULL,s2,n);
// cppcheck-suppress nullPointer
(void)memcpy(s1,NULL,n);
(void)memcpy(s1,s2,n);
}
void nullPointer_strncmp(const char *s1, const char *s2, size_t n)
{
// cppcheck-suppress nullPointer

View File

@ -1283,6 +1283,16 @@ void nullPointer_wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n)
(void)std::wmemcmp(s1,s2,n);
}
void nullPointer_memcmp(const void *s1, const void *s2, size_t n)
{
// cppcheck-suppress nullPointer
(void)std::memcmp(NULL,s2,n);
// cppcheck-suppress nullPointer
(void)std::memcmp(s1,NULL,n);
(void)std::memcmp(s1,s2,n);
}
void nullPointer_strncat(char *d, char *s, size_t n)
{
// cppcheck-suppress nullPointer
@ -3591,10 +3601,22 @@ void nullPointer_atof(void)
(void)std::atof(0);
}
void nullPointer_memcmp(char *p)
void nullPointer_memcpy(void *s1, const void *s2, size_t n)
{
// cppcheck-suppress nullPointer
(void)std::memcmp(p, 0, 123);
(void)std::memcpy(NULL,s2,n);
// cppcheck-suppress nullPointer
(void)std::memcpy(s1,NULL,n);
(void)std::memcpy(s1,s2,n);
}
void nullPointer_memmove(void *s1, void *s2, size_t n)
{
// cppcheck-suppress nullPointer
(void)std::memmove(NULL,s2,n);
// cppcheck-suppress nullPointer
(void)std::memmove(s1,NULL,n);
(void)std::memmove(s1,s2,n);
}
///////////////////////////////////////////////////////////////////////