Example #1
0
oval_schema_version_t oval_definition_model_get_platform_schema_version(struct oval_definition_model *model, const char *platform)
{
	if (model == NULL || model->generator == NULL) {
		return OVAL_SCHEMA_VERSION_INVALID;
	}
	const char *version = oval_generator_get_platform_schema_version(model->generator, platform);
	return oval_schema_version_from_cstr(version);
}
Example #2
0
int main(int argc, char **argv)
{
	if (argc != 4) {
		printf("Not enough arguments\n");
		return 1;
	}
	const char *v1_str = argv[1];
	const char *v2_str = argv[2];
	int expected_result = atoi(argv[3]);
	oval_schema_version_t v1 = oval_schema_version_from_cstr(v1_str);
	oval_schema_version_t v2 = oval_schema_version_from_cstr(v2_str);
	int cmp = oval_schema_version_cmp(v1, v2);
	int retval;
	if (cmp == expected_result) {
		retval = 0;
		printf("\tPASS\t%s %s %s\n", v1_str, cmp_to_cstr(cmp), v2_str);
	} else {
		retval = 1;
		printf("\tFAIL\t%s %s %s but expected result is '%s'\n", v1_str,
			cmp_to_cstr(cmp), v2_str, cmp_to_cstr(expected_result));
	}
	return retval;
}