#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);
#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;
#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> {
#include <stdlib.h>
#include <string.h>
-#include "test_shared.h"
-
#include <gtest/gtest.h>
+#include "test_shared.h"
+
#define MAX_LENGTH (32)
typedef struct {
#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];
#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;
#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)
#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];
#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) {
#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)
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