2018-03-18 13:03:19 +01:00
|
|
|
// 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:
|
2018-03-18 13:22:33 +01:00
|
|
|
// $ cppcheck --enable=warning,information --inline-suppr --platform=unix64 generated-cfg-tests-sdl.cpp
|
2018-03-18 13:03:19 +01:00
|
|
|
// => 'unmatched suppression' warnings are false negatives.
|
|
|
|
//
|
|
|
|
|
|
|
|
void test__SDL_mutexP__noreturn() {
|
2018-03-18 13:22:33 +01:00
|
|
|
int x = 1;
|
|
|
|
if (cond) { x=100; SDL_mutexP(arg1); }
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress shiftTooManyBits
|
|
|
|
x = 1 << x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_mutexP__arg1__notbool() {
|
|
|
|
// cppcheck-suppress invalidFunctionArgBool
|
|
|
|
SDL_mutexP(!x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_mutexP__arg1__notnull() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
SDL_mutexP(p);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_mutexV__noreturn() {
|
2018-03-18 13:22:33 +01:00
|
|
|
int x = 1;
|
|
|
|
if (cond) { x=100; SDL_mutexV(arg1); }
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress shiftTooManyBits
|
|
|
|
x = 1 << x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_mutexV__arg1__notbool() {
|
|
|
|
// cppcheck-suppress invalidFunctionArgBool
|
|
|
|
SDL_mutexV(!x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_mutexV__arg1__notnull() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
SDL_mutexV(p);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_RWsize__noreturn() {
|
2018-03-18 13:22:33 +01:00
|
|
|
int x = 1;
|
|
|
|
if (cond) { x=100; SDL_RWsize(arg1); }
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress shiftTooManyBits
|
|
|
|
x = 1 << x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_RWsize__arg1__notbool() {
|
|
|
|
// cppcheck-suppress invalidFunctionArgBool
|
|
|
|
SDL_RWsize(!x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_RWsize__arg1__notnull() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
SDL_RWsize(p);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_RWread__noreturn() {
|
2018-03-18 13:22:33 +01:00
|
|
|
int x = 1;
|
|
|
|
if (cond) { x=100; SDL_RWread(arg1, arg2); }
|
2018-03-18 13:03:19 +01:00
|
|
|
// 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() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
SDL_RWread(p, arg2);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_RWread__arg2__notbool() {
|
|
|
|
// cppcheck-suppress invalidFunctionArgBool
|
|
|
|
SDL_RWread(arg1, !x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__SDL_RWread__arg2__notnull() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
SDL_RWread(arg1, p);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void test__IMG_isPNG__noreturn() {
|
2018-03-18 13:22:33 +01:00
|
|
|
int x = 1;
|
|
|
|
if (cond) { x=100; IMG_isPNG(arg1); }
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress shiftTooManyBits
|
|
|
|
x = 1 << x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__IMG_isPNG__arg1__notbool() {
|
|
|
|
// cppcheck-suppress invalidFunctionArgBool
|
|
|
|
IMG_isPNG(!x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__IMG_isPNG__arg1__notnull() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
IMG_isPNG(p);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void test__IMG_isJPG__noreturn() {
|
2018-03-18 13:22:33 +01:00
|
|
|
int x = 1;
|
|
|
|
if (cond) { x=100; IMG_isJPG(arg1); }
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress shiftTooManyBits
|
|
|
|
x = 1 << x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__IMG_isJPG__arg1__notbool() {
|
|
|
|
// cppcheck-suppress invalidFunctionArgBool
|
|
|
|
IMG_isJPG(!x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void test__IMG_isJPG__arg1__notnull() {
|
2018-03-18 13:53:46 +01:00
|
|
|
const char *p = NULL;
|
2018-03-18 13:03:19 +01:00
|
|
|
// cppcheck-suppress nullPointer
|
2018-03-18 13:53:46 +01:00
|
|
|
IMG_isJPG(p);
|
2018-03-18 13:03:19 +01:00
|
|
|
}
|
|
|
|
|