aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/test_html.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/test_html.c')
-rw-r--r--src/plugins/test_html.c124
1 files changed, 124 insertions, 0 deletions
diff --git a/src/plugins/test_html.c b/src/plugins/test_html.c
new file mode 100644
index 0000000..150dac1
--- /dev/null
+++ b/src/plugins/test_html.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_html.c
22 * @brief testcase for html plugin
23 * @author Christian Grothoff
24 */
25#include "platform.h"
26#include "test_lib.h"
27
28
29/**
30 * Main function for the HTML testcase.
31 *
32 * @param argc number of arguments (ignored)
33 * @param argv arguments (ignored)
34 * @return 0 on success
35 */
36int
37main (int argc, char *argv[])
38{
39 struct SolutionData html_grothoff_sol[] =
40 {
41 {
42 EXTRACTOR_METATYPE_TITLE,
43 EXTRACTOR_METAFORMAT_UTF8,
44 "text/plain",
45 "Christian Grothoff",
46 strlen ("Christian Grothoff") + 1,
47 0
48 },
49 {
50 EXTRACTOR_METATYPE_DESCRIPTION,
51 EXTRACTOR_METAFORMAT_UTF8,
52 "text/plain",
53 "Homepage of Christian Grothoff",
54 strlen ("Homepage of Christian Grothoff") + 1,
55 0
56 },
57 {
58 EXTRACTOR_METATYPE_AUTHOR_NAME,
59 EXTRACTOR_METAFORMAT_UTF8,
60 "text/plain",
61 "Christian Grothoff",
62 strlen ("Christian Grothoff") + 1,
63 0
64 },
65 {
66 EXTRACTOR_METATYPE_KEYWORDS,
67 EXTRACTOR_METAFORMAT_UTF8,
68 "text/plain",
69 "Christian,Grothoff",
70 strlen ("Christian,Grothoff") + 1,
71 0
72 },
73 {
74 EXTRACTOR_METATYPE_TITLE,
75 EXTRACTOR_METAFORMAT_UTF8,
76 "text/plain",
77 "Welcome to Christian Grothoff",
78 strlen ("Welcome to Christian Grothoff") + 1,
79 0
80 },
81 {
82 EXTRACTOR_METATYPE_LANGUAGE,
83 EXTRACTOR_METAFORMAT_UTF8,
84 "text/plain",
85 "en",
86 strlen ("en") + 1,
87 0
88 },
89 {
90 EXTRACTOR_METATYPE_PUBLISHER,
91 EXTRACTOR_METAFORMAT_UTF8,
92 "text/plain",
93 "Christian Grothoff",
94 strlen ("Christian Grothoff") + 1,
95 0
96 },
97 {
98 EXTRACTOR_METATYPE_UNKNOWN_DATE,
99 EXTRACTOR_METAFORMAT_UTF8,
100 "text/plain",
101 "2000-08-20",
102 strlen ("2000-08-20") + 1,
103 0
104 },
105 {
106 EXTRACTOR_METATYPE_RIGHTS,
107 EXTRACTOR_METAFORMAT_UTF8,
108 "text/plain",
109 "(C) 2000 by Christian Grothoff",
110 strlen ("(C) 2000 by Christian Grothoff") + 1,
111 0
112 },
113 { 0, 0, NULL, NULL, 0, -1 }
114 };
115 struct ProblemSet ps[] =
116 {
117 { "testdata/html_grothoff.html",
118 html_grothoff_sol },
119 { NULL, NULL }
120 };
121 return ET_main ("html", ps);
122}
123
124/* end of test_html.c */