add script to generate cfg tests

This commit is contained in:
Daniel Marjamäki 2018-03-18 13:03:19 +01:00
parent 52fb9d3743
commit cf180dcc6b
12 changed files with 62715 additions and 0 deletions

14
test/cfg/generate-cfg-tests.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
cd ~/cppcheck
make generate_cfg_tests
./generate_cfg_tests cfg/avr.cfg > test/cfg/generated-cfg-tests-avr.cpp
./generate_cfg_tests cfg/bsd.cfg > test/cfg/generated-cfg-tests-bsd.cpp
./generate_cfg_tests cfg/gnu.cfg > test/cfg/generated-cfg-tests-gnu.cpp
./generate_cfg_tests cfg/motif.cfg > test/cfg/generated-cfg-tests-motif.cpp
./generate_cfg_tests cfg/posix.cfg > test/cfg/generated-cfg-tests-posix.cpp
./generate_cfg_tests cfg/qt.cfg > test/cfg/generated-cfg-tests-qt.cpp
./generate_cfg_tests cfg/sdl.cfg > test/cfg/generated-cfg-tests-sdl.cpp
./generate_cfg_tests cfg/sfml.cfg > test/cfg/generated-cfg-tests-sfml.cpp
./generate_cfg_tests cfg/std.cfg > test/cfg/generated-cfg-tests-std.cpp
./generate_cfg_tests cfg/windows.cfg > test/cfg/generated-cfg-tests-windows.cpp
./generate_cfg_tests cfg/wxwidgets.cfg > test/cfg/generated-cfg-tests-wxwidgets.cpp

View File

@ -0,0 +1,606 @@
// auto generated tests from cfg/avr.cfg
//
// Generated by command:
// ./generate_cfg_tests cfg/avr.cfg > generated-cfg-tests-avr.cpp
//
// Recommended cppcheck command line:
// $ cppcheck --enable=warning,information --inline-suppr generated-cfg-tests-avr.cpp
// => 'unmatched suppression' warnings are false negatives.
//
void test__toascii__noreturn() {
int x = 100;
if (cond) x=1; else toascii(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__toascii__leakignore() {
char *p = strdup(str);
toascii(p);
// cppcheck-suppress memleak
}
void test__vfprintf_P__noreturn() {
int x = 100;
if (cond) x=1; else vfprintf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__vfprintf_P__leakignore() {
char *p = strdup(str);
vfprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__vfprintf_P__arg1__notnull() {
// cppcheck-suppress nullPointer
vfprintf_P(NULL, arg2);
}
void test__vfprintf_P__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
vfprintf_P(x, arg2);
}
void test__printf_P__noreturn() {
int x = 100;
if (cond) x=1; else printf_P(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__printf_P__leakignore() {
char *p = strdup(str);
printf_P(p);
// cppcheck-suppress memleak
}
void test__sprintf_P__noreturn() {
int x = 100;
if (cond) x=1; else sprintf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__sprintf_P__leakignore() {
char *p = strdup(str);
sprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__snprintf_P__noreturn() {
int x = 100;
if (cond) x=1; else snprintf_P(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__snprintf_P__leakignore() {
char *p = strdup(str);
snprintf_P(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__vsprintf_P__noreturn() {
int x = 100;
if (cond) x=1; else vsprintf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__vsprintf_P__leakignore() {
char *p = strdup(str);
vsprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__vsnprintf_P__noreturn() {
int x = 100;
if (cond) x=1; else vsnprintf_P(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__vsnprintf_P__leakignore() {
char *p = strdup(str);
vsnprintf_P(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__fprintf_P__noreturn() {
int x = 100;
if (cond) x=1; else fprintf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fprintf_P__leakignore() {
char *p = strdup(str);
fprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fprintf_P__arg1__notnull() {
// cppcheck-suppress nullPointer
fprintf_P(NULL, arg2);
}
void test__fprintf_P__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fprintf_P(x, arg2);
}
void test__fputs_P__noreturn() {
int x = 100;
if (cond) x=1; else fputs_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fputs_P__leakignore() {
char *p = strdup(str);
fputs_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fputs_P__arg1__notnull() {
// cppcheck-suppress nullPointer
fputs_P(NULL, arg2);
}
void test__fputs_P__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fputs_P(x, arg2);
}
void test__fputs_P__arg2__notnull() {
// cppcheck-suppress nullPointer
fputs_P(arg1, NULL);
}
void test__fputs_P__arg2__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fputs_P(arg1, x);
}
void test__puts_P__noreturn() {
int x = 100;
if (cond) x=1; else puts_P(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__puts_P__leakignore() {
char *p = strdup(str);
puts_P(p);
// cppcheck-suppress memleak
}
void test__puts_P__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
puts_P(!x);
}
void test__puts_P__arg1__notnull() {
// cppcheck-suppress nullPointer
puts_P(NULL);
}
void test__puts_P__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
puts_P(x);
}
void test__scanf_P__noreturn() {
int x = 100;
if (cond) x=1; else scanf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__scanf_P__leakignore() {
char *p = strdup(str);
scanf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__scanf_P__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
scanf_P(x, arg2);
}
void test__fscanf_P__noreturn() {
int x = 100;
if (cond) x=1; else fscanf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fscanf_P__leakignore() {
char *p = strdup(str);
fscanf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fscanf_P__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fscanf_P(x, arg2);
}
void test__sscanf_P__noreturn() {
int x = 100;
if (cond) x=1; else sscanf_P(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__sscanf_P__leakignore() {
char *p = strdup(str);
sscanf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fdevopen__noreturn() {
int x = 100;
if (cond) x=1; else fdevopen(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fdevopen__arg1__notnull() {
// cppcheck-suppress nullPointer
fdevopen(NULL, arg2);
}
void test__fdevopen__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fdevopen(x, arg2);
}
void test__fdevopen__arg2__notnull() {
// cppcheck-suppress nullPointer
fdevopen(arg1, NULL);
}
void test__fdevopen__arg2__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fdevopen(arg1, x);
}
void test__ltoa__noreturn() {
int x = 100;
if (cond) x=1; else ltoa(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ltoa__leakignore() {
char *p = strdup(str);
ltoa(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__ltoa__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
ltoa(x, arg2, arg3);
}
void test__ltoa__arg2__notnull() {
// cppcheck-suppress nullPointer
ltoa(arg1, NULL, arg3);
}
void test__ltoa__arg2__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
ltoa(arg1, x, arg3);
}
void test__ltoa__arg3__notnull() {
// cppcheck-suppress nullPointer
ltoa(arg1, arg2, NULL);
}
void test__ltoa__arg3__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
ltoa(arg1, arg2, x);
}
void test__utoa__noreturn() {
int x = 100;
if (cond) x=1; else utoa(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__utoa__leakignore() {
char *p = strdup(str);
utoa(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__utoa__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
utoa(x, arg2, arg3);
}
void test__utoa__arg2__notnull() {
// cppcheck-suppress nullPointer
utoa(arg1, NULL, arg3);
}
void test__utoa__arg2__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
utoa(arg1, x, arg3);
}
void test__utoa__arg3__notnull() {
// cppcheck-suppress nullPointer
utoa(arg1, arg2, NULL);
}
void test__utoa__arg3__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
utoa(arg1, arg2, x);
}
void test__ultoa__noreturn() {
int x = 100;
if (cond) x=1; else ultoa(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ultoa__leakignore() {
char *p = strdup(str);
ultoa(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__ultoa__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
ultoa(x, arg2, arg3);
}
void test__ultoa__arg2__notnull() {
// cppcheck-suppress nullPointer
ultoa(arg1, NULL, arg3);
}
void test__ultoa__arg2__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
ultoa(arg1, x, arg3);
}
void test__ultoa__arg3__notnull() {
// cppcheck-suppress nullPointer
ultoa(arg1, arg2, NULL);
}
void test__ultoa__arg3__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
ultoa(arg1, arg2, x);
}
void test__random__noreturn() {
int x = 100;
if (cond) x=1; else random();
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__random__leakignore() {
char *p = strdup(str);
random();
// cppcheck-suppress memleak
}
void test__random_r__noreturn() {
int x = 100;
if (cond) x=1; else random_r(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__random_r__leakignore() {
char *p = strdup(str);
random_r(p);
// cppcheck-suppress memleak
}
void test__random_r__arg1__notnull() {
// cppcheck-suppress nullPointer
random_r(NULL);
}
void test__srandom__noreturn() {
int x = 100;
if (cond) x=1; else srandom(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__srandom__leakignore() {
char *p = strdup(str);
srandom(p);
// cppcheck-suppress memleak
}
void test__srandom__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
srandom(x);
}
void test__dtostre__noreturn() {
int x = 100;
if (cond) x=1; else dtostre(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__dtostre__leakignore() {
char *p = strdup(str);
dtostre(p, arg2);
// cppcheck-suppress memleak
}
void test__dtostre__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
dtostre(x, arg2);
}
void test__dtostre__arg2__notnull() {
// cppcheck-suppress nullPointer
dtostre(arg1, NULL);
}
void test__dtostrf__noreturn() {
int x = 100;
if (cond) x=1; else dtostrf(arg1, arg2, arg3, arg4);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__dtostrf__leakignore() {
char *p = strdup(str);
dtostrf(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__dtostrf__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
dtostrf(x, arg2, arg3, arg4);
}
void test__dtostrf__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
dtostrf(arg1, x, arg3, arg4);
}
void test__dtostrf__arg3__notuninit() {
int x;
// cppcheck-suppress uninitvar
dtostrf(arg1, arg2, x, arg4);
}
void test__dtostrf__arg4__notnull() {
// cppcheck-suppress nullPointer
dtostrf(arg1, arg2, arg3, NULL);
}
void test__ffs__noreturn() {
int x = 100;
if (cond) x=1; else ffs(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ffs__leakignore() {
char *p = strdup(str);
ffs(p);
// cppcheck-suppress memleak
}
void test__ffs__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
ffs(x);
}
void test__ffsl__noreturn() {
int x = 100;
if (cond) x=1; else ffsl(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ffsl__leakignore() {
char *p = strdup(str);
ffsl(p);
// cppcheck-suppress memleak
}
void test__ffsl__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
ffsl(x);
}
void test__ffsll__noreturn() {
int x = 100;
if (cond) x=1; else ffsll(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ffsll__leakignore() {
char *p = strdup(str);
ffsll(p);
// cppcheck-suppress memleak
}
void test__ffsll__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
ffsll(x);
}
void test__memccpy__noreturn() {
int x = 100;
if (cond) x=1; else memccpy(arg1, arg2, arg3, arg4);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__memccpy__leakignore() {
char *p = strdup(str);
memccpy(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__memccpy__arg1__notnull() {
// cppcheck-suppress nullPointer
memccpy(NULL, arg2, arg3, arg4);
}
void test__memccpy__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
memccpy(arg1, x, arg3, arg4);
}
void test__memccpy__arg3__notuninit() {
int x;
// cppcheck-suppress uninitvar
memccpy(arg1, arg2, x, arg4);
}
void test__memccpy__arg4__notuninit() {
int x;
// cppcheck-suppress uninitvar
memccpy(arg1, arg2, arg3, x);
}

View File

@ -0,0 +1,256 @@
// auto generated tests from cfg/bsd.cfg
//
// Generated by command:
// ./generate_cfg_tests cfg/bsd.cfg > generated-cfg-tests-bsd.cpp
//
// Recommended cppcheck command line:
// $ cppcheck --enable=warning,information --inline-suppr generated-cfg-tests-bsd.cpp
// => 'unmatched suppression' warnings are false negatives.
//
void test__fts_open__noreturn() {
int x = 100;
if (cond) x=1; else fts_open(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_open__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_open(x, arg2, arg3);
}
void test__fts_open__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_open(arg1, x, arg3);
}
void test__fts_open__arg3__notnull() {
// cppcheck-suppress nullPointer
fts_open(arg1, arg2, NULL);
}
void test__fts_open__arg3__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fts_open(arg1, arg2, x);
}
void test__fts_read__noreturn() {
int x = 100;
if (cond) x=1; else fts_read(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_read__arg1__notnull() {
// cppcheck-suppress nullPointer
fts_read(NULL);
}
void test__fts_read__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
fts_read(x);
}
void test__readpassphrase__noreturn() {
int x = 100;
if (cond) x=1; else readpassphrase(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__readpassphrase__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
readpassphrase(x, arg2);
}
void test__readpassphrase__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
readpassphrase(arg1, x);
}
void test__fts_set__noreturn() {
int x = 100;
if (cond) x=1; else fts_set(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_set__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_set(x, arg2, arg3);
}
void test__fts_set__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_set(arg1, x, arg3);
}
void test__fts_set__arg3__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_set(arg1, arg2, x);
}
void test__fts_set_clientptr__noreturn() {
int x = 100;
if (cond) x=1; else fts_set_clientptr(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_set_clientptr__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_set_clientptr(x, arg2);
}
void test__fts_set_clientptr__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_set_clientptr(arg1, x);
}
void test__fts_get_clientptr__noreturn() {
int x = 100;
if (cond) x=1; else fts_get_clientptr(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_get_clientptr__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_get_clientptr(x);
}
void test__fts_get_stream__noreturn() {
int x = 100;
if (cond) x=1; else fts_get_stream(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_get_stream__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_get_stream(x);
}
void test__fts_close__noreturn() {
int x = 100;
if (cond) x=1; else fts_close(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_close__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
fts_close(x);
}
void test__readpassphrase__noreturn() {
int x = 100;
if (cond) x=1; else readpassphrase(arg1, arg2, arg3, arg4);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__readpassphrase__leakignore() {
char *p = strdup(str);
readpassphrase(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__readpassphrase__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
readpassphrase(x, arg2, arg3, arg4);
}
void test__readpassphrase__arg2__notnull() {
// cppcheck-suppress nullPointer
readpassphrase(arg1, NULL, arg3, arg4);
}
void test__readpassphrase__arg3__notnull() {
// cppcheck-suppress nullPointer
readpassphrase(arg1, arg2, NULL, arg4);
}
void test__readpassphrase__arg3__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
readpassphrase(arg1, arg2, x, arg4);
}
void test__readpassphrase__arg4__notuninit() {
int x;
// cppcheck-suppress uninitvar
readpassphrase(arg1, arg2, arg3, x);
}
void test__setfib__noreturn() {
int x = 100;
if (cond) x=1; else setfib(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__setfib__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
setfib(x);
}
void test__strtonum__noreturn() {
int x = 100;
if (cond) x=1; else strtonum(arg1, arg2, arg3, arg4);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__strtonum__leakignore() {
char *p = strdup(str);
strtonum(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__strtonum__arg1__notnull() {
// cppcheck-suppress nullPointer
strtonum(NULL, arg2, arg3, arg4);
}
void test__strtonum__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
strtonum(x, arg2, arg3, arg4);
}
void test__strtonum__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
strtonum(arg1, x, arg3, arg4);
}
void test__strtonum__arg3__notuninit() {
int x;
// cppcheck-suppress uninitvar
strtonum(arg1, arg2, x, arg4);
}
void test__strtonum__arg4__notuninit() {
int x;
// cppcheck-suppress uninitvar
strtonum(arg1, arg2, arg3, x);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,460 @@
// auto generated tests from cfg/motif.cfg
//
// Generated by command:
// ./generate_cfg_tests cfg/motif.cfg > generated-cfg-tests-motif.cpp
//
// Recommended cppcheck command line:
// $ cppcheck --enable=warning,information --inline-suppr generated-cfg-tests-motif.cpp
// => 'unmatched suppression' warnings are false negatives.
//
void test__MrmCloseHierarchy__noreturn() {
int x = 100;
if (cond) x=1; else MrmCloseHierarchy(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__MrmCloseHierarchy__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
MrmCloseHierarchy(x);
}
void test__MrmOpenHierarchy__noreturn() {
int x = 100;
if (cond) x=1; else result = MrmOpenHierarchy(arg1, arg2, arg3, arg4);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__MrmOpenHierarchy__useretval() {
// cppcheck-suppress ignoredReturnValue
MrmOpenHierarchy(arg1, arg2, arg3, arg4);
}
void test__MrmOpenHierarchyPerDisplay__noreturn() {
int x = 100;
if (cond) x=1; else result = MrmOpenHierarchyPerDisplay(arg1, arg2, arg3, arg4, arg5);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__MrmOpenHierarchyPerDisplay__useretval() {
// cppcheck-suppress ignoredReturnValue
MrmOpenHierarchyPerDisplay(arg1, arg2, arg3, arg4, arg5);
}
void test__XmFontListEntryFree__noreturn() {
int x = 100;
if (cond) x=1; else XmFontListEntryFree(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmFontListEntryFree__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XmFontListEntryFree(x);
}
void test__XmFontListCreate__noreturn() {
int x = 100;
if (cond) x=1; else result = XmFontListCreate(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmFontListCreate__useretval() {
// cppcheck-suppress ignoredReturnValue
XmFontListCreate(arg1, arg2);
}
void test__XmFontListCreate__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XmFontListCreate(x, arg2);
}
void test__XmFontListCreate__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XmFontListCreate(arg1, x);
}
void test__XmFontListAppendEntry__noreturn() {
int x = 100;
if (cond) x=1; else result = XmFontListAppendEntry(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmFontListAppendEntry__useretval() {
// cppcheck-suppress ignoredReturnValue
XmFontListAppendEntry(arg1, arg2);
}
void test__XmFontListAppendEntry__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XmFontListAppendEntry(x, arg2);
}
void test__XmFontListAppendEntry__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XmFontListAppendEntry(arg1, x);
}
void test__XmStringCreateLocalized__noreturn() {
int x = 100;
if (cond) x=1; else result = XmStringCreateLocalized(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringCreateLocalized__useretval() {
// cppcheck-suppress ignoredReturnValue
XmStringCreateLocalized(arg1);
}
void test__XmStringCreateLocalized__leakignore() {
char *p = strdup(str);
result = XmStringCreateLocalized(p);
// cppcheck-suppress memleak
}
void test__XmStringCreateLocalized__arg1__notnull() {
// cppcheck-suppress nullPointer
result = XmStringCreateLocalized(NULL);
}
void test__XmStringCreateLocalized__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
result = XmStringCreateLocalized(x);
}
void test__XmStringCreateSimple__noreturn() {
int x = 100;
if (cond) x=1; else result = XmStringCreateSimple(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringCreateSimple__useretval() {
// cppcheck-suppress ignoredReturnValue
XmStringCreateSimple(arg1);
}
void test__XmStringCreateSimple__leakignore() {
char *p = strdup(str);
result = XmStringCreateSimple(p);
// cppcheck-suppress memleak
}
void test__XmStringCreateSimple__arg1__notnull() {
// cppcheck-suppress nullPointer
result = XmStringCreateSimple(NULL);
}
void test__XmStringCreateSimple__arg1__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
result = XmStringCreateSimple(x);
}
void test__XmStringFree__noreturn() {
int x = 100;
if (cond) x=1; else XmStringFree(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringFree__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XmStringFree(x);
}
void test__XmStringGenerate__noreturn() {
int x = 100;
if (cond) x=1; else XmStringGenerate(arg1, arg2, arg3, arg4);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringGenerate__leakignore() {
char *p = strdup(str);
XmStringGenerate(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__XmTextGetString__noreturn() {
int x = 100;
if (cond) x=1; else XmTextGetString(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmTextGetString__leakignore() {
char *p = strdup(str);
XmTextGetString(p);
// cppcheck-suppress memleak
}
void test__XmTextGetString__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XmTextGetString(x);
}
void test__XmTextGetStringWcs__noreturn() {
int x = 100;
if (cond) x=1; else XmTextGetStringWcs(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmTextGetStringWcs__leakignore() {
char *p = strdup(str);
XmTextGetStringWcs(p);
// cppcheck-suppress memleak
}
void test__XmTextGetStringWcs__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XmTextGetStringWcs(x);
}
void test__XtAsprintf__arg2__notnull() {
// cppcheck-suppress nullPointer
XtAsprintf(arg1, NULL);
}
void test__XtAsprintf__arg2__notuninit() {
int x[10];
// cppcheck-suppress uninitvar
XtAsprintf(arg1, x);
}
void test__XtFree__noreturn() {
int x = 100;
if (cond) x=1; else XtFree(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtFree__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XtFree(x);
}
void test__XtSetValues__noreturn() {
int x = 100;
if (cond) x=1; else XtSetValues(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtSetValues__leakignore() {
char *p = strdup(str);
XtSetValues(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__XtGetValues__noreturn() {
int x = 100;
if (cond) x=1; else XtGetValues(arg1, arg2, arg3);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtGetValues__leakignore() {
char *p = strdup(str);
XtGetValues(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__XtSetSubvalues__noreturn() {
int x = 100;
if (cond) x=1; else XtSetSubvalues(arg1, arg2, arg3, arg4, arg5);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtSetSubvalues__leakignore() {
char *p = strdup(str);
XtSetSubvalues(p, arg2, arg3, arg4, arg5);
// cppcheck-suppress memleak
}
void test__XtGetSubvalues__noreturn() {
int x = 100;
if (cond) x=1; else XtGetSubvalues(arg1, arg2, arg3, arg4, arg5);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtGetSubvalues__leakignore() {
char *p = strdup(str);
XtGetSubvalues(p, arg2, arg3, arg4, arg5);
// cppcheck-suppress memleak
}
void test__XtMalloc__noreturn() {
int x = 100;
if (cond) x=1; else result = XtMalloc(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtMalloc__useretval() {
// cppcheck-suppress ignoredReturnValue
XtMalloc(arg1);
}
void test__XtMalloc__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XtMalloc(x);
}
void test__XtNew__noreturn() {
int x = 100;
if (cond) x=1; else result = XtNew(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtNew__useretval() {
// cppcheck-suppress ignoredReturnValue
XtNew(arg1);
}
void test__XtNew__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XtNew(x);
}
void test__XtNewString__noreturn() {
int x = 100;
if (cond) x=1; else result = XtNewString(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtNewString__useretval() {
// cppcheck-suppress ignoredReturnValue
XtNewString(arg1);
}
void test__XtNewString__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XtNewString(x);
}
void test__XtCalloc__noreturn() {
int x = 100;
if (cond) x=1; else result = XtCalloc(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtCalloc__useretval() {
// cppcheck-suppress ignoredReturnValue
XtCalloc(arg1, arg2);
}
void test__XtCalloc__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XtCalloc(x, arg2);
}
void test__XtCalloc__arg2__notuninit() {
int x;
// cppcheck-suppress uninitvar
result = XtCalloc(arg1, x);
}
void test__XOpenDisplay__noreturn() {
int x = 100;
if (cond) x=1; else XOpenDisplay(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XOpenDisplay__leakignore() {
char *p = strdup(str);
XOpenDisplay(p);
// cppcheck-suppress memleak
}
void test__XOpenDisplay__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XOpenDisplay(x);
}
void test__XCloseDisplay__noreturn() {
int x = 100;
if (cond) x=1; else XCloseDisplay(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XCloseDisplay__leakignore() {
char *p = strdup(str);
XCloseDisplay(p);
// cppcheck-suppress memleak
}
void test__XCloseDisplay__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XCloseDisplay(x);
}
void test__XtDatabase__noreturn() {
int x = 100;
if (cond) x=1; else XtDatabase(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtDatabase__leakignore() {
char *p = strdup(str);
XtDatabase(p);
// cppcheck-suppress memleak
}
void test__XtDatabase__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XtDatabase(x);
}
void test__XtScreenDatabase__noreturn() {
int x = 100;
if (cond) x=1; else XtScreenDatabase(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtScreenDatabase__leakignore() {
char *p = strdup(str);
XtScreenDatabase(p);
// cppcheck-suppress memleak
}
void test__XtScreenDatabase__arg1__notuninit() {
int x;
// cppcheck-suppress uninitvar
XtScreenDatabase(x);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,122 @@
// auto generated tests from cfg/sdl.cfg
//
// Generated by command:
// ./generate_cfg_tests cfg/sdl.cfg > generated-cfg-tests-sdl.cpp
//
// Recommended cppcheck command line:
// $ cppcheck --enable=warning,information --inline-suppr generated-cfg-tests-sdl.cpp
// => 'unmatched suppression' warnings are false negatives.
//
void test__SDL_mutexP__noreturn() {
int x = 100;
if (cond) x=1; else SDL_mutexP(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_mutexP__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
SDL_mutexP(!x);
}
void test__SDL_mutexP__arg1__notnull() {
// cppcheck-suppress nullPointer
SDL_mutexP(NULL);
}
void test__SDL_mutexV__noreturn() {
int x = 100;
if (cond) x=1; else SDL_mutexV(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_mutexV__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
SDL_mutexV(!x);
}
void test__SDL_mutexV__arg1__notnull() {
// cppcheck-suppress nullPointer
SDL_mutexV(NULL);
}
void test__SDL_RWsize__noreturn() {
int x = 100;
if (cond) x=1; else SDL_RWsize(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_RWsize__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
SDL_RWsize(!x);
}
void test__SDL_RWsize__arg1__notnull() {
// cppcheck-suppress nullPointer
SDL_RWsize(NULL);
}
void test__SDL_RWread__noreturn() {
int x = 100;
if (cond) x=1; else SDL_RWread(arg1, arg2);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_RWread__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
SDL_RWread(!x, arg2);
}
void test__SDL_RWread__arg1__notnull() {
// cppcheck-suppress nullPointer
SDL_RWread(NULL, arg2);
}
void test__SDL_RWread__arg2__notbool() {
// cppcheck-suppress invalidFunctionArgBool
SDL_RWread(arg1, !x);
}
void test__SDL_RWread__arg2__notnull() {
// cppcheck-suppress nullPointer
SDL_RWread(arg1, NULL);
}
void test__IMG_isPNG__noreturn() {
int x = 100;
if (cond) x=1; else IMG_isPNG(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__IMG_isPNG__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
IMG_isPNG(!x);
}
void test__IMG_isPNG__arg1__notnull() {
// cppcheck-suppress nullPointer
IMG_isPNG(NULL);
}
void test__IMG_isJPG__noreturn() {
int x = 100;
if (cond) x=1; else IMG_isJPG(arg1);
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__IMG_isJPG__arg1__notbool() {
// cppcheck-suppress invalidFunctionArgBool
IMG_isJPG(!x);
}
void test__IMG_isJPG__arg1__notnull() {
// cppcheck-suppress nullPointer
IMG_isJPG(NULL);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff