diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-08-04 00:13:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-08-04 00:13:00 +0000 |
commit | 8d9d1b9e088c0616b99866aa7fb39e0ea53123fc (patch) | |
tree | 6323d8aca40a3382098026cc035afa25f93b700f /src/plugins/test_mime.c | |
parent | 0b6bf1a71e8466e4a3fb83000232da5d81b4a4da (diff) | |
download | libextractor-8d9d1b9e088c0616b99866aa7fb39e0ea53123fc.tar.gz libextractor-8d9d1b9e088c0616b99866aa7fb39e0ea53123fc.zip |
get mime plugin working again, this time using libmagic
Diffstat (limited to 'src/plugins/test_mime.c')
-rw-r--r-- | src/plugins/test_mime.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/plugins/test_mime.c b/src/plugins/test_mime.c new file mode 100644 index 0000000..d3aa786 --- /dev/null +++ b/src/plugins/test_mime.c | |||
@@ -0,0 +1,61 @@ | |||
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_mime.c | ||
22 | * @brief testcase for ogg plugin | ||
23 | * @author Christian Grothoff | ||
24 | */ | ||
25 | #include "platform.h" | ||
26 | #include "test_lib.h" | ||
27 | |||
28 | |||
29 | |||
30 | /** | ||
31 | * Main function for the MIME testcase. | ||
32 | * | ||
33 | * @param argc number of arguments (ignored) | ||
34 | * @param argv arguments (ignored) | ||
35 | * @return 0 on success | ||
36 | */ | ||
37 | int | ||
38 | main (int argc, char *argv[]) | ||
39 | { | ||
40 | struct SolutionData courseclear_sol[] = | ||
41 | { | ||
42 | { | ||
43 | EXTRACTOR_METATYPE_MIMETYPE, | ||
44 | EXTRACTOR_METAFORMAT_UTF8, | ||
45 | "text/plain", | ||
46 | "application/ogg", | ||
47 | strlen ("application/ogg") + 1, | ||
48 | 0 | ||
49 | }, | ||
50 | { 0, 0, NULL, NULL, 0, -1 } | ||
51 | }; | ||
52 | struct ProblemSet ps[] = | ||
53 | { | ||
54 | { "testdata/ogg_courseclear.ogg", | ||
55 | courseclear_sol }, | ||
56 | { NULL, NULL } | ||
57 | }; | ||
58 | return ET_main ("mime", ps); | ||
59 | } | ||
60 | |||
61 | /* end of test_mime.c */ | ||