| 1 |
/* test_version.cc - Test zVersion() and zlibCompileFlags() */ |
| 2 |
|
| 3 |
#include "zbuild.h" |
| 4 |
#ifdef ZLIB_COMPAT |
| 5 |
# include "zlib.h" |
| 6 |
#else |
| 7 |
# include "zlib-ng.h" |
| 8 |
#endif |
| 9 |
|
| 10 |
#include <stdio.h> |
| 11 |
#include <stdint.h> |
| 12 |
#include <stdlib.h> |
| 13 |
#include <string.h> |
| 14 |
|
| 15 |
#include "test_shared.h" |
| 16 |
|
| 17 |
#include <gtest/gtest.h> |
| 18 |
|
| 19 |
TEST(version, basic) { |
| 20 |
static const char *my_version = PREFIX2(VERSION); |
| 21 |
|
| 22 |
EXPECT_EQ(zVersion()[0], my_version[0]); |
| 23 |
EXPECT_STREQ(zVersion(), PREFIX2(VERSION)); |
| 24 |
|
| 25 |
printf("zlib-ng version %s = 0x%08lx, compile flags = 0x%lx\n", |
| 26 |
ZLIBNG_VERSION, ZLIBNG_VERNUM, PREFIX(zlibCompileFlags)()); |
| 27 |
} |