diff options
Diffstat (limited to 'src/plugins/test_dvi.c')
-rw-r--r-- | src/plugins/test_dvi.c | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/src/plugins/test_dvi.c b/src/plugins/test_dvi.c new file mode 100644 index 0000000..40920a4 --- /dev/null +++ b/src/plugins/test_dvi.c | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | This file is part of libextractor. | ||
3 | (C) 2012 Vidyut Samanta and Christian Grothoff | ||
4 | |||
5 | libextractor is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | libextractor is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with libextractor; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file plugins/test_dvi.c | ||
22 | * @brief testcase for dvi plugin | ||
23 | * @author Christian Grothoff | ||
24 | */ | ||
25 | #include "platform.h" | ||
26 | #include "test_lib.h" | ||
27 | |||
28 | |||
29 | /** | ||
30 | * Main function for the DVI testcase. | ||
31 | * | ||
32 | * @param argc number of arguments (ignored) | ||
33 | * @param argv arguments (ignored) | ||
34 | * @return 0 on success | ||
35 | */ | ||
36 | int | ||
37 | main (int argc, char *argv[]) | ||
38 | { | ||
39 | struct SolutionData dvi_ora_sol[] = | ||
40 | { | ||
41 | { | ||
42 | EXTRACTOR_METATYPE_MIMETYPE, | ||
43 | EXTRACTOR_METAFORMAT_UTF8, | ||
44 | "text/plain", | ||
45 | "application/x-dvi", | ||
46 | strlen ("application/x-dvi") + 1, | ||
47 | 0 | ||
48 | }, | ||
49 | { | ||
50 | EXTRACTOR_METATYPE_PAGE_COUNT, | ||
51 | EXTRACTOR_METAFORMAT_UTF8, | ||
52 | "text/plain", | ||
53 | "10", | ||
54 | strlen ("10") + 1, | ||
55 | 0 | ||
56 | }, | ||
57 | { | ||
58 | EXTRACTOR_METATYPE_TITLE, | ||
59 | EXTRACTOR_METAFORMAT_C_STRING, | ||
60 | "text/plain", | ||
61 | "Optimal Bitwise Register Allocation using Integer Linear Programming", | ||
62 | strlen ("Optimal Bitwise Register Allocation using Integer Linear Programming") + 1, | ||
63 | 0 | ||
64 | }, | ||
65 | { | ||
66 | EXTRACTOR_METATYPE_SUBJECT, | ||
67 | EXTRACTOR_METAFORMAT_C_STRING, | ||
68 | "text/plain", | ||
69 | "Register Allocation", | ||
70 | strlen ("Register Allocation") + 1, | ||
71 | 0 | ||
72 | }, | ||
73 | { | ||
74 | EXTRACTOR_METATYPE_COMMENT, | ||
75 | EXTRACTOR_METAFORMAT_C_STRING, | ||
76 | "text/plain", | ||
77 | " TeX output 2005.02.06:0725", | ||
78 | strlen (" TeX output 2005.02.06:0725") + 1, | ||
79 | 0 | ||
80 | }, | ||
81 | { | ||
82 | EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE, | ||
83 | EXTRACTOR_METAFORMAT_C_STRING, | ||
84 | "text/plain", | ||
85 | "LaTeX with hyperref package", | ||
86 | strlen ("LaTeX with hyperref package") + 1, | ||
87 | 0 | ||
88 | }, | ||
89 | { | ||
90 | EXTRACTOR_METATYPE_AUTHOR_NAME, | ||
91 | EXTRACTOR_METAFORMAT_C_STRING, | ||
92 | "text/plain", | ||
93 | "Rajkishore Barik and Christian Grothoff and Rahul Gupta and Vinayaka Pandit and Raghavendra Udupa", | ||
94 | strlen ("Rajkishore Barik and Christian Grothoff and Rahul Gupta and Vinayaka Pandit and Raghavendra Udupa") + 1, | ||
95 | 0 | ||
96 | }, | ||
97 | { | ||
98 | EXTRACTOR_METATYPE_PRODUCED_BY_SOFTWARE, | ||
99 | EXTRACTOR_METAFORMAT_C_STRING, | ||
100 | "text/plain", | ||
101 | "dvips + Distiller", | ||
102 | strlen ("dvips + Distiller") + 1, | ||
103 | 0 | ||
104 | }, | ||
105 | { | ||
106 | EXTRACTOR_METATYPE_KEYWORDS, | ||
107 | EXTRACTOR_METAFORMAT_C_STRING, | ||
108 | "text/plain", | ||
109 | "register allocation integer linear programming bit-wise spilling coalesing rematerialization", | ||
110 | strlen ("register allocation integer linear programming bit-wise spilling coalesing rematerialization") + 1, | ||
111 | 0 | ||
112 | }, | ||
113 | { 0, 0, NULL, NULL, 0, -1 } | ||
114 | }; | ||
115 | struct ProblemSet ps[] = | ||
116 | { | ||
117 | { "testdata/dvi_ora.dvi", | ||
118 | dvi_ora_sol }, | ||
119 | { NULL, NULL } | ||
120 | }; | ||
121 | return ET_main ("dvi", ps); | ||
122 | } | ||
123 | |||
124 | /* end of test_dvi.c */ | ||