summaryrefslogtreecommitdiff
path: root/test/test_version.cc
blob: fda87904e0de8c132100eeae3b5bb632d60275f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* test_version.cc - Test zVersion() and zlibCompileFlags() */

#include "zbuild.h"
#ifdef ZLIB_COMPAT
#  include "zlib.h"
#else
#  include "zlib-ng.h"
#endif

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "test_shared.h"

#include <gtest/gtest.h>

TEST(version, basic) {
    static const char *my_version = PREFIX2(VERSION);

    EXPECT_EQ(zVersion()[0], my_version[0]);
    EXPECT_STREQ(zVersion(), PREFIX2(VERSION));

    printf("zlib-ng version %s = 0x%08lx, compile flags = 0x%lx\n",
            ZLIBNG_VERSION, ZLIBNG_VERNUM, PREFIX(zlibCompileFlags)());
}