| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 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 |
} |