2015-03-30 18:57:16 +03:00
|
|
|
#include <freerdp/version.h>
|
|
|
|
#include <freerdp/freerdp.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:57:16 +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:57:16 +03:00
|
|
|
freerdp_get_version(&major, &minor, &revision);
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:57:16 +03:00
|
|
|
if (major != FREERDP_VERSION_MAJOR)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (minor != FREERDP_VERSION_MINOR)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (revision != FREERDP_VERSION_REVISION)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
version = freerdp_get_version_string();
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:57:16 +03:00
|
|
|
if (!version)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
git = freerdp_get_build_revision();
|
2019-02-08 11:18:16 +03:00
|
|
|
|
2015-03-30 18:57:16 +03:00
|
|
|
if (!git)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (strncmp(git, GIT_REVISION, sizeof(GIT_REVISION)))
|
|
|
|
return -1;
|
|
|
|
|
2016-01-28 16:26:50 +03:00
|
|
|
build = freerdp_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:57:16 +03:00
|
|
|
return 0;
|
|
|
|
}
|