Tell scan-build ASSERT_TRUE() behaves like assert().

This commit is contained in:
Mika T. Lindqvist 2022-12-15 06:51:51 +02:00 committed by Hans Kristian Rosbach
parent 31ce5efac4
commit 06b579a3c4
11 changed files with 27 additions and 16 deletions

View File

@ -11,6 +11,8 @@ extern "C" {
#include <gtest/gtest.h>
#include "test_shared.h"
void *zng_calloc_unaligned(void *opaque, unsigned items, unsigned size) {
uint8_t *pointer = (uint8_t *)calloc(1, (items * size) + 2);
Z_UNUSED(opaque);

View File

@ -15,8 +15,11 @@ extern "C" {
#include <gtest/gtest.h>
#include "test_shared.h"
#define MAX_COMPARE_SIZE (256)
/* Ensure that compare256 returns the correct match length */
static inline void compare256_match_check(compare256_func compare256) {
int32_t match_len, i;

View File

@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
#define MAX_LENGTH (32)
class compress_bound_variant : public testing::TestWithParam<int32_t> {

View File

@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
#define MAX_LENGTH (32)
typedef struct {

View File

@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
TEST(deflate, dictionary) {
PREFIX3(stream) c_stream;
uint8_t compr[128];

View File

@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
TEST(deflate, header) {
PREFIX3(stream) c_stream;
PREFIX(gz_header) *head;

View File

@ -16,10 +16,10 @@
#include "deflate.h"
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
#define COMPR_BUFFER_SIZE (48 * 1024)
#define UNCOMPR_BUFFER_SIZE (64 * 1024)
#define UNCOMPR_RAND_SIZE (8 * 1024)

View File

@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
TEST(deflate, pending) {
PREFIX3(stream) c_stream;
uint8_t compr[128];

View File

@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
#define TESTFILE "foo.gz"
TEST(gzip, readwrite) {

View File

@ -13,10 +13,10 @@
#include <string.h>
#include <time.h>
#include "test_shared.h"
#include <gtest/gtest.h>
#include "test_shared.h"
#define COMPR_BUFFER_SIZE (48 * 1024)
#define UNCOMPR_BUFFER_SIZE (32 * 1024)
#define UNCOMPR_RAND_SIZE (8 * 1024)

View File

@ -9,4 +9,10 @@
static const char hello[] = "hello, hello!";
static const int hello_len = sizeof(hello);
/* Clang static analyzer doesn't understand googletest's ASSERT_TRUE, so we need to tell that it's like assert() */
#ifdef __clang_analyzer__
# undef ASSERT_TRUE
# define ASSERT_TRUE assert
#endif
#endif