mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-23 10:50:05 +00:00
Suppress a bogus coverity warning
This commit is contained in:
parent
13e0e38d99
commit
ab25cd2c8b
@ -140,7 +140,7 @@ template <>
|
|||||||
struct IntChecker<true> {
|
struct IntChecker<true> {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static bool fits_in_int(T value) {
|
static bool fits_in_int(T value) {
|
||||||
return value >= INT_MIN && value <= INT_MAX;
|
return internal::check(value >= INT_MIN) && value <= INT_MAX;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -61,10 +61,10 @@ TEST(FormatTest, StrError) {
|
|||||||
EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = 0, 0), "invalid buffer");
|
EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = 0, 0), "invalid buffer");
|
||||||
EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = buffer, 0), "invalid buffer");
|
EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = buffer, 0), "invalid buffer");
|
||||||
buffer[0] = 'x';
|
buffer[0] = 'x';
|
||||||
#ifdef _GNU_SOURCE
|
#if defined(_GNU_SOURCE) && !defined(__COVERITY__)
|
||||||
// Use invalid error code to make sure that safe_strerror returns an error
|
// Use invalid error code to make sure that safe_strerror returns an error
|
||||||
// message in the buffer rather than a pointer to a static string.
|
// message in the buffer rather than a pointer to a static string.
|
||||||
volatile int error_code = -1;
|
int error_code = -1;
|
||||||
#else
|
#else
|
||||||
int error_code = EDOM;
|
int error_code = EDOM;
|
||||||
#endif
|
#endif
|
||||||
|
@ -326,11 +326,13 @@ TEST(FileTest, Dup) {
|
|||||||
EXPECT_EQ(FILE_CONTENT, read(copy, std::strlen(FILE_CONTENT)));
|
EXPECT_EQ(FILE_CONTENT, read(copy, std::strlen(FILE_CONTENT)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __COVERITY__
|
||||||
TEST(FileTest, DupError) {
|
TEST(FileTest, DupError) {
|
||||||
volatile int value = -1;
|
int value = -1;
|
||||||
EXPECT_SYSTEM_ERROR_NOASSERT(File::dup(value),
|
EXPECT_SYSTEM_ERROR_NOASSERT(File::dup(value),
|
||||||
EBADF, "cannot duplicate file descriptor -1");
|
EBADF, "cannot duplicate file descriptor -1");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST(FileTest, Dup2) {
|
TEST(FileTest, Dup2) {
|
||||||
File f = open_file();
|
File f = open_file();
|
||||||
|
Loading…
Reference in New Issue
Block a user