diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-08-19 22:00:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-08-19 22:00:33 +0000 |
commit | b6ec961ce81587547bd074ca6f3fe1d57a34d56a (patch) | |
tree | c84c0923ed84065d6607c8c1da6b81a6ba0595b7 | |
parent | d67cc47327362d0c0710536a9b1a458cc5bcbb27 (diff) | |
download | libextractor-b6ec961ce81587547bd074ca6f3fe1d57a34d56a.tar.gz libextractor-b6ec961ce81587547bd074ca6f3fe1d57a34d56a.zip |
adding SID testcase
-rw-r--r-- | src/plugins/Makefile.am | 14 | ||||
-rw-r--r-- | src/plugins/test_sid.c | 124 | ||||
-rw-r--r-- | src/plugins/testdata/sid_wizball.sid | bin | 0 -> 8448 bytes |
3 files changed, 131 insertions, 7 deletions
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 5093003..94e4b3b 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am | |||
@@ -40,6 +40,7 @@ EXTRA_DIST = \ | |||
40 | testdata/ps_wallace.ps \ | 40 | testdata/ps_wallace.ps \ |
41 | testdata/rpm_test.rpm \ | 41 | testdata/rpm_test.rpm \ |
42 | testdata/s3m_2nd_pm.s3m \ | 42 | testdata/s3m_2nd_pm.s3m \ |
43 | testdata/sid_wizball.sid \ | ||
43 | testdata/thumbnail_torsten.jpg \ | 44 | testdata/thumbnail_torsten.jpg \ |
44 | testdata/tiff_haute.tiff \ | 45 | testdata/tiff_haute.tiff \ |
45 | testdata/wav_noise.wav \ | 46 | testdata/wav_noise.wav \ |
@@ -180,6 +181,7 @@ check_PROGRAMS = \ | |||
180 | test_png \ | 181 | test_png \ |
181 | test_riff \ | 182 | test_riff \ |
182 | test_s3m \ | 183 | test_s3m \ |
184 | test_sid \ | ||
183 | test_wav \ | 185 | test_wav \ |
184 | test_xm \ | 186 | test_xm \ |
185 | test_zip \ | 187 | test_zip \ |
@@ -494,6 +496,11 @@ libextractor_sid_la_SOURCES = \ | |||
494 | libextractor_sid_la_LDFLAGS = \ | 496 | libextractor_sid_la_LDFLAGS = \ |
495 | $(PLUGINFLAGS) | 497 | $(PLUGINFLAGS) |
496 | 498 | ||
499 | test_sid_SOURCES = \ | ||
500 | test_sid.c | ||
501 | test_sid_LDADD = \ | ||
502 | $(top_builddir)/src/plugins/libtest.la | ||
503 | |||
497 | 504 | ||
498 | libextractor_archive_la_SOURCES = \ | 505 | libextractor_archive_la_SOURCES = \ |
499 | archive_extractor.c | 506 | archive_extractor.c |
@@ -559,13 +566,6 @@ test_wav_SOURCES = \ | |||
559 | test_wav_LDADD = \ | 566 | test_wav_LDADD = \ |
560 | $(top_builddir)/src/plugins/libtest.la | 567 | $(top_builddir)/src/plugins/libtest.la |
561 | 568 | ||
562 | test_gstreamer_SOURCES = \ | ||
563 | test_gstreamer.c | ||
564 | test_gstreamer_LDADD = \ | ||
565 | $(top_builddir)/src/plugins/libtest.la \ | ||
566 | $(GSTREAMER_LIBS) $(GSTREAMER_PBUTILS_LIBS) | ||
567 | test_gstreamer_CFLAGS = \ | ||
568 | $(GSTREAMER_CFLAGS) $(GSTREAMER_PBUTILS_CFLAGS) | ||
569 | 569 | ||
570 | libextractor_xm_la_SOURCES = \ | 570 | libextractor_xm_la_SOURCES = \ |
571 | xm_extractor.c | 571 | xm_extractor.c |
diff --git a/src/plugins/test_sid.c b/src/plugins/test_sid.c new file mode 100644 index 0000000..465d17c --- /dev/null +++ b/src/plugins/test_sid.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_sid.c | ||
22 | * @brief testcase for sid plugin | ||
23 | * @author Christian Grothoff | ||
24 | */ | ||
25 | #include "platform.h" | ||
26 | #include "test_lib.h" | ||
27 | |||
28 | |||
29 | /** | ||
30 | * Main function for the SID 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 sid_wizball_sol[] = | ||
40 | { | ||
41 | { | ||
42 | EXTRACTOR_METATYPE_MIMETYPE, | ||
43 | EXTRACTOR_METAFORMAT_UTF8, | ||
44 | "text/plain", | ||
45 | "audio/prs.sid", | ||
46 | strlen ("audio/prs.sid") + 1, | ||
47 | 0 | ||
48 | }, | ||
49 | { | ||
50 | EXTRACTOR_METATYPE_FORMAT_VERSION, | ||
51 | EXTRACTOR_METAFORMAT_UTF8, | ||
52 | "text/plain", | ||
53 | "2", | ||
54 | strlen ("2") + 1, | ||
55 | 0 | ||
56 | }, | ||
57 | { | ||
58 | EXTRACTOR_METATYPE_SONG_COUNT, | ||
59 | EXTRACTOR_METAFORMAT_UTF8, | ||
60 | "text/plain", | ||
61 | "9", | ||
62 | strlen ("9") + 1, | ||
63 | 0 | ||
64 | }, | ||
65 | { | ||
66 | EXTRACTOR_METATYPE_STARTING_SONG, | ||
67 | EXTRACTOR_METAFORMAT_UTF8, | ||
68 | "text/plain", | ||
69 | "4", | ||
70 | strlen ("4") + 1, | ||
71 | 0 | ||
72 | }, | ||
73 | { | ||
74 | EXTRACTOR_METATYPE_ALBUM, | ||
75 | EXTRACTOR_METAFORMAT_UTF8, | ||
76 | "text/plain", | ||
77 | "Wizball", | ||
78 | strlen ("Wizball") + 1, | ||
79 | 0 | ||
80 | }, | ||
81 | { | ||
82 | EXTRACTOR_METATYPE_ARTIST, | ||
83 | EXTRACTOR_METAFORMAT_UTF8, | ||
84 | "text/plain", | ||
85 | "Martin Galway", | ||
86 | strlen ("Martin Galway") + 1, | ||
87 | 0 | ||
88 | }, | ||
89 | { | ||
90 | EXTRACTOR_METATYPE_COPYRIGHT, | ||
91 | EXTRACTOR_METAFORMAT_UTF8, | ||
92 | "text/plain", | ||
93 | "1987 Ocean", | ||
94 | strlen ("1987 Ocean") + 1, | ||
95 | 0 | ||
96 | }, | ||
97 | { | ||
98 | EXTRACTOR_METATYPE_BROADCAST_TELEVISION_SYSTEM, | ||
99 | EXTRACTOR_METAFORMAT_UTF8, | ||
100 | "text/plain", | ||
101 | "PAL", | ||
102 | strlen ("PAL") + 1, | ||
103 | 0 | ||
104 | }, | ||
105 | { | ||
106 | EXTRACTOR_METATYPE_TARGET_ARCHITECTURE, | ||
107 | EXTRACTOR_METAFORMAT_UTF8, | ||
108 | "text/plain", | ||
109 | "MOS6581", | ||
110 | strlen ("MOS6581") + 1, | ||
111 | 0 | ||
112 | }, | ||
113 | { 0, 0, NULL, NULL, 0, -1 } | ||
114 | }; | ||
115 | struct ProblemSet ps[] = | ||
116 | { | ||
117 | { "testdata/sid_wizball.sid", | ||
118 | sid_wizball_sol }, | ||
119 | { NULL, NULL } | ||
120 | }; | ||
121 | return ET_main ("sid", ps); | ||
122 | } | ||
123 | |||
124 | /* end of test_sid.c */ | ||
diff --git a/src/plugins/testdata/sid_wizball.sid b/src/plugins/testdata/sid_wizball.sid new file mode 100644 index 0000000..1d3e82f --- /dev/null +++ b/src/plugins/testdata/sid_wizball.sid | |||
Binary files differ | |||