source: libyaml/trunk/tests/test-version.c @ 169

Revision 169, 618 bytes checked in by xi, 9 years ago (diff)

Add the basic autoconf infrastructure.

RevLine 
[169]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}
Note: See TracBrowser for help on using the repository browser.