coverity: Add missing functions to model file

This commit is contained in:
Andreas Schneider 2023-02-03 12:47:42 +01:00
parent 4fccbc3466
commit a79b97cb92
1 changed files with 47 additions and 3 deletions

View File

@ -18,6 +18,7 @@
* See also https://scan.coverity.com/models
*/
typedef int int32_t;
typedef long long intmax_t;
typedef unsigned long long uintmax_t;
/* size_t is already defined by Coverity */
@ -70,13 +71,56 @@ void _assert_uint_not_equal(const uintmax_t a,
}
void _assert_return_code(const intmax_t result,
size_t rlen,
const uintmax_t error,
const int32_t error,
const char * const expression,
const char * const file,
const int line)
{
if (result != 0) {
if (result < 0) {
__coverity_panic__();
}
}
void _assert_float_equal(const float a,
const float b,
const float epsilon,
const char * const file,
const int line)
{
if (a != b) {
__coverity_panic__();
}
}
void _assert_float_not_equal(const float a,
const float b,
const float epsilon,
const char * const file,
const int line)
{
if (a == b) {
__coverity_panic__();
}
}
void _assert_double_equal(const double a,
const double b,
const double epsilon,
const char * const file,
const int line)
{
if (a != b) {
__coverity_panic__();
}
}
void _assert_double_not_equal(const double a,
const double b,
const double epsilon,
const char * const file,
const int line)
{
if (a != b) {
__coverity_panic__();
}
}