diff options
Diffstat (limited to '')
-rw-r--r-- | winpr/libwinpr/utils/test/TestVersion.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/winpr/libwinpr/utils/test/TestVersion.c b/winpr/libwinpr/utils/test/TestVersion.c new file mode 100644 index 0000000..71a1d74 --- /dev/null +++ b/winpr/libwinpr/utils/test/TestVersion.c @@ -0,0 +1,47 @@ + +#include <winpr/crt.h> + +#include <winpr/version.h> +#include <winpr/winpr.h> + +int TestVersion(int argc, char* argv[]) +{ + const char* version = NULL; + const char* git = NULL; + const char* build = NULL; + int major = 0; + int minor = 0; + int revision = 0; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + winpr_get_version(&major, &minor, &revision); + + if (major != WINPR_VERSION_MAJOR) + return -1; + + if (minor != WINPR_VERSION_MINOR) + return -1; + + if (revision != WINPR_VERSION_REVISION) + return -1; + + version = winpr_get_version_string(); + + if (!version) + return -1; + + git = winpr_get_build_revision(); + + if (!git) + return -1; + + if (strncmp(git, WINPR_GIT_REVISION, sizeof(WINPR_GIT_REVISION))) + return -1; + + build = winpr_get_build_config(); + + if (!build) + return -1; + + return 0; +} |