Debian Codegraph @

tests/checkTable.c

raw symbols SCIP
1 /* liblouis Braille Translation and Back-Translation Library
2
3 Copyright (C) 2012 James Teh <[email protected]>
4 Copyright (C) 2015 Davy Kager <[email protected]>
5
6 Copying and distribution of this file, with or without modification,
7 are permitted in any medium without royalty provided the copyright
8 notice and this notice are preserved. This file is offered as-is,
9 without any warranty. */
10
11 #include <config.h>
12
13 #include <stdio.h>
14 #include <string.h>
15 #include <stdlib.h>
16 #include "liblouis.h"
17
18 int
19 main(int argc, char **argv)
20 {
21 const char *goodTable = "tables/en-us-g1.ctb";
22 const char *badTable = "tests/tables/bad.ctb";
23 int result = 0;
24
25 if (lou_checkTable(goodTable) == 0)
26 {
27 printf("Getting %s failed, expected success\n", goodTable);
28 result = 1;
29 }
30
31 if (lou_checkTable(badTable) != 0)
32 {
33 printf("Getting %s succeeded, expected failure\n", badTable);
34 result = 1;
35 }
36
37 if (lou_checkTable(goodTable) == 0)
38 {
39 printf("Getting %s failed, expected success\n", goodTable);
40 result = 1;
41 }
42
43 lou_free();
44
45 return result;
46 }