summaryrefslogtreecommitdiff
path: root/test/VersionSuite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/VersionSuite.cpp')
-rw-r--r--test/VersionSuite.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/VersionSuite.cpp b/test/VersionSuite.cpp
index fb28c15..c85bbd2 100644
--- a/test/VersionSuite.cpp
+++ b/test/VersionSuite.cpp
@@ -20,9 +20,6 @@
#include <gtest/gtest.h>
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE // for asprintf
-#endif
#include <stdio.h>
@@ -31,8 +28,8 @@
TEST(VersionSuite, EnsureVersionDefinesInSync) {
- char * INSIDE_VERSION = NULL;
- const int bytes_printed = asprintf(&INSIDE_VERSION, "%d.%d.%d%s",
+ char INSIDE_VERSION[256];
+ const int bytes_printed = sprintf(INSIDE_VERSION, "%d.%d.%d%s",
URI_VER_MAJOR, URI_VER_MINOR, URI_VER_RELEASE, URI_VER_SUFFIX_ANSI);
ASSERT_TRUE(bytes_printed != -1);
@@ -42,6 +39,5 @@ TEST(VersionSuite, EnsureVersionDefinesInSync) {
printf(" Tarball version: <%s>\n", PACKAGE_VERSION);
printf(" Header defines version: <%s>\n", INSIDE_VERSION);
}
- free(INSIDE_VERSION);
ASSERT_TRUE(equal);
}