test/test-library-version.c
raw| 1 | #include <assert.h> |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | int |
| 5 | main(void) |
| 6 | { |
| 7 | const char *version = LIBINPUT_LT_VERSION; |
| 8 | int C, R, A; |
| 9 | int rc; |
| 10 | |
| 11 | rc = sscanf(version, "%d:%d:%d", &C, &R, &A); |
| 12 | assert(rc == 3); |
| 13 | |
| 14 | assert(C >= 17); |
| 15 | assert(R >= 0); |
| 16 | assert(A >= 7); |
| 17 | |
| 18 | /* Binary compatibility broken? */ |
| 19 | assert(R != 0 || A != 0); |
| 20 | |
| 21 | /* The first stable API in 0.12 had 10:0:0 */ |
| 22 | assert(C - A == 10); |
| 23 | |
| 24 | return 0; |
| 25 | } |