Christian Egli | ef2e8a1 | 2015-05-07 09:37:23 +0200 | [diff] [blame] | 1 | /* liblouis Braille Translation and Back-Translation Library |
| 2 | |
| 3 | Copyright (C) 2012 James Teh <jamie@nvaccess.org> |
| 4 | |
| 5 | Copying and distribution of this file, with or without modification, |
| 6 | are permitted in any medium without royalty provided the copyright |
| 7 | notice and this notice are preserved. This file is offered as-is, |
| 8 | without any warranty. */ |
| 9 | |
James Teh | 7dc0d92 | 2012-09-20 04:32:54 +0000 | [diff] [blame] | 10 | #include <stdio.h> |
| 11 | #include <string.h> |
| 12 | #include <stdlib.h> |
| 13 | #include "liblouis.h" |
| 14 | |
| 15 | int |
| 16 | main(int argc, char **argv) |
| 17 | { |
Christian Egli | 9553960 | 2016-10-06 17:26:42 +0200 | [diff] [blame] | 18 | const char* goodTable = "tables/en-us-g1.ctb"; |
| 19 | const char* badTable = "tests/tables/bad.ctb"; |
Bert Frees | 47e6911 | 2019-08-22 13:09:36 +0200 | [diff] [blame] | 20 | const void* table = NULL; |
James Teh | 7dc0d92 | 2012-09-20 04:32:54 +0000 | [diff] [blame] | 21 | int result = 0; |
| 22 | |
| 23 | table = lou_getTable(goodTable); |
| 24 | if (!table) |
| 25 | { |
| 26 | printf("Getting %s failed, expected success\n", goodTable); |
| 27 | result = 1; |
| 28 | } |
| 29 | else |
| 30 | table = NULL; |
| 31 | |
| 32 | table = lou_getTable(badTable); |
| 33 | if (table) |
| 34 | { |
| 35 | printf("Getting %s succeeded, expected failure\n", badTable); |
| 36 | table = NULL; |
| 37 | result = 1; |
| 38 | } |
| 39 | |
| 40 | table = lou_getTable(goodTable); |
| 41 | if (!table) |
| 42 | { |
| 43 | printf("Getting %s failed, expected success\n", goodTable); |
| 44 | result = 1; |
| 45 | } |
| 46 | else |
| 47 | table = NULL; |
| 48 | |
| 49 | lou_free(); |
| 50 | |
| 51 | return result; |
| 52 | } |