aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2021-08-05 06:08:12 +0200
committerFriedrich W. H. Kossebau <kossebau@kde.org>2021-08-05 06:08:12 +0200
commita0f8e5469f388840d99aa8e8ff6f404cc16a66ad (patch)
treeadcaa25646d5d0edbdf6db45610f055dcbc7fc24 /tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c
parent3d946c0ef81874e26743967ec2322e75944d784a (diff)
downloadextra-cmake-modules-a0f8e5469f388840d99aa8e8ff6f404cc16a66ad.tar.gz
extra-cmake-modules-a0f8e5469f388840d99aa8e8ff6f404cc16a66ad.tar.bz2
ecm_setup_version: deal with 0-prefixed version values in PROJECT mode
5c191fa1d2383c69ddc075395e04f84b7679613a already added the same sanity check for the non-PROJECT mode
Diffstat (limited to 'tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c')
-rw-r--r--tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c b/tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c
new file mode 100644
index 00000000..ec5bdcf0
--- /dev/null
+++ b/tests/ECMSetupVersionTest/new_project_header_zero_prefixed_version/main.c
@@ -0,0 +1,24 @@
+#include <new_project_header_zero_prefixed_version.h>
+#include <string.h>
+#include <stdio.h>
+
+#define intcheck(macro,val) \
+ if (macro != val) { \
+ printf(#macro " was %d instead of %d", macro, val); \
+ return 1; \
+ }
+#define strcheck(macro,val) \
+ if (strcmp(macro,val) != 0) { \
+ printf(#macro " was %s instead of %s", macro, val); \
+ return 1; \
+ }
+
+int main()
+{
+ intcheck(new_project_header_zero_prefixed_version_VERSION_MAJOR,8)
+ intcheck(new_project_header_zero_prefixed_version_VERSION_MINOR,9)
+ intcheck(new_project_header_zero_prefixed_version_VERSION_PATCH,7)
+ intcheck(new_project_header_zero_prefixed_version_VERSION,((8 << 16) + (9 << 8) + 7))
+ strcheck(new_project_header_zero_prefixed_version_VERSION_STRING,"08.09.07")
+ return 0;
+}