mirror of
https://github.com/GerbilSoft/zlib-ng.git
synced 2025-06-18 11:35:35 -04:00
Tell scan-build ASSERT_TRUE() behaves like assert().
This commit is contained in:
parent
31ce5efac4
commit
06b579a3c4
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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> {
|
||||
|
@ -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 {
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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];
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user