]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Tell scan-build ASSERT_TRUE() behaves like assert().
authorMika T. Lindqvist <postmaster@raasu.org>
Thu, 15 Dec 2022 04:51:51 +0000 (06:51 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 29 Dec 2022 10:03:31 +0000 (11:03 +0100)
test/test_aligned_alloc.cc
test/test_compare256.cc
test/test_compress_bound.cc
test/test_deflate_bound.cc
test/test_deflate_dict.cc
test/test_deflate_header.cc
test/test_deflate_params.cc
test/test_deflate_pending.cc
test/test_gzio.cc
test/test_large_buffers.cc
test/test_shared.h

index 259d474b87745d7ff6e89f36c09634f4902dacb4..de73c7ec322d8c73cfcfd2d950fd94fd3ae51197 100644 (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);
index 7c4dab98991864632727b5b7668e50dfb1c1efe4..663ad96334b5ec5b5909eed9a225904836bbced3 100644 (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;
index cd5f6e5b95b4632c8443dd57701c590f1fda03f6..d51452b2353d916e399f36713d592666a754f925 100644 (file)
 #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> {
index 27020c6f92c27cbc3adb2d41d72ec63a886b1173..8de65535f29439047d9b9f8082b5d61be05ffdc8 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_shared.h"
-
 #include <gtest/gtest.h>
 
+#include "test_shared.h"
+
 #define MAX_LENGTH (32)
 
 typedef struct {
index 7a060a8dea19aea715af0794500465dbda9d5b60..781c70db272cad7a402c0dfa9a1e4bb0eef5a47f 100644 (file)
 #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];
index 92f4612089d2df06b37717a45d3ba3615cf74106..46d3478c1e81069be5f28a6092bfc5616bcf5a49 100644 (file)
 #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;
index f5f5066ad1eba60a0abc0defff39047790f10e32..9fadea85f9733848393a571b9cfa9703033eaa36 100644 (file)
 
 #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)
index b107dd43c1fa6253b132c1491b13c7534e23d7bd..8ccedbf33d073fd30a402b506e0992f500cb9735 100644 (file)
 #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];
index 59e46f520a5cb54be6e620c129f97775f2ad6779..3cab1dbe408fdeb79dbba775074a39155a188dcf 100644 (file)
 #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) {
index 9bf133998affe75b2d53f9df72301db425fdc004..3c1208140de4fd637a2eaab8e8258c6cad7186dc 100644 (file)
 #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)
index df92a56b3b9193cf75d1653ff159822438f8eb7a..616f57342c538f62111c1218e99b4fe21adc9c76 100644 (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