Debian Codegraph @

tests/typeform_for_emphclass.c

raw symbols SCIP
1 /* liblouis Braille Translation and Back-Translation Library
2
3 Copyright (C) 2016 Swiss Library for the Blind, Visually Impaired and Print Disabled
4 Copyright (C) 2016 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 int result = 0;
22 const char *table = "tests/tables/emphclass/emphclass_valid.utb";
23 const char *class;
24 class = "italic";
25 formtype typeform = italic;
26 if (lou_getTypeformForEmphClass(table, class) != typeform) {
27 fprintf(stderr, "%s should have typeform %x\n", class, typeform);
28 result = 1;
29 }
30 class = "underline";
31 typeform = underline;
32 if (lou_getTypeformForEmphClass(table, class) != typeform) {
33 fprintf(stderr, "%s should have typeform %x\n", class, typeform);
34 result = 1;
35 }
36 class = "bold";
37 typeform = bold;
38 if (lou_getTypeformForEmphClass(table, class) != typeform) {
39 fprintf(stderr, "%s should have typeform %x\n", class, typeform);
40 result = 1;
41 }
42 class = "foo";
43 typeform = emph_4;
44 if (lou_getTypeformForEmphClass(table, class) != typeform) {
45 fprintf(stderr, "%s should have typeform %x\n", class, typeform);
46 result = 1;
47 }
48 class = "bar";
49 if (lou_getTypeformForEmphClass(table, class) != 0) {
50 fprintf(stderr, "%s should not be defined\n", class);
51 result = 1;
52 }
53 lou_free();
54 return result;
55 }