2015-03-30 18:50:47 +03:00
|
|
|
|
|
|
|
#include <winpr/crt.h>
|
|
|
|
|
|
|
|
#include <winpr/version.h>
|
|
|
|
#include <winpr/winpr.h>
|
|
|
|
|
|
|
|
int TestVersion(int argc, char* argv[])
|
|
|
|
{
|
2019-02-08 11:18:16 +03:00
|
|
|
const char* version;
|
|
|
|
const char* git;
|
|
|
|
const char* build;
|
2015-03-30 18:50:47 +03:00
|
|
|
int major = 0, minor = 0, revision = 0;
|
2019-02-08 11:18:16 +03:00
|
|
|
WINPR_UNUSED(argc);
|
|
|
|
WINPR_UNUSED(argv);
|
2015-03-30 18:50:47 +03:00
|
|
|
winpr_get_version(&major, &minor, &revision);
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:50:47 +03:00
|
|
|
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();
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:50:47 +03:00
|
|
|
if (!version)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
git = winpr_get_build_revision();
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:50:47 +03:00
|
|
|
if (!git)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (strncmp(git, GIT_REVISION, sizeof(GIT_REVISION)))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
build = winpr_get_build_date();
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:50:47 +03:00
|
|
|
if (!build)
|
|
|
|
return -1;
|
|
|
|
|
2016-01-28 16:26:50 +03:00
|
|
|
build = winpr_get_build_config();
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2016-01-28 16:26:50 +03:00
|
|
|
if (!build)
|
|
|
|
return -1;
|
|
|
|
|
2015-03-30 18:50:47 +03:00
|
|
|
return 0;
|
|
|
|
}
|