]> andersk Git - libyaml.git/blame - tests/test-version.c
Add the basic autoconf infrastructure.
[libyaml.git] / tests / test-version.c
CommitLineData
cec6fc98
KS
1#include <yaml/yaml.h>
2
3#include <stdlib.h>
4#include <stdio.h>
5#include <assert.h>
6
7int
8main(void)
9{
10 int major, minor, patch;
11 char buf[64];
12
13 yaml_get_version(&major, &minor, &patch);
14 sprintf(buf, "%d.%d.%d", major, minor, patch);
15 assert(strcmp(buf, yaml_get_version_string()) == 0);
16 assert(yaml_check_version(major+1, minor, patch) == 0);
17 assert(yaml_check_version(major, minor+1, patch) == 0);
18 assert(yaml_check_version(major, minor, patch+1) == 1);
19 assert(yaml_check_version(major, minor, patch) == 1);
20 assert(yaml_check_version(major, minor, patch-1) == 0);
21
22 return 0;
23}
This page took 0.044928 seconds and 5 git commands to generate.