blob: 5aed3dd7f14f71a9f82ede499604e2b9098277a6 [file] [log] [blame]
Christian Eglief2e8a12015-05-07 09:37:23 +02001/* liblouis Braille Translation and Back-Translation Library
2
3Copyright (C) 2012 James Teh <jamie@nvaccess.org>
4
5Copying and distribution of this file, with or without modification,
6are permitted in any medium without royalty provided the copyright
7notice and this notice are preserved. This file is offered as-is,
8without any warranty. */
9
James Teh7dc0d922012-09-20 04:32:54 +000010#include <stdio.h>
11#include <string.h>
12#include <stdlib.h>
13#include "liblouis.h"
14
15int
16main(int argc, char **argv)
17{
Christian Egli95539602016-10-06 17:26:42 +020018 const char* goodTable = "tables/en-us-g1.ctb";
19 const char* badTable = "tests/tables/bad.ctb";
Bert Frees47e69112019-08-22 13:09:36 +020020 const void* table = NULL;
James Teh7dc0d922012-09-20 04:32:54 +000021 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}