libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 75a7e3d593b154fb3b5a07f30550e2e68b6ea052
parent d9a5c0645b80b3d1760f758282ca987898aed54c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  9 Aug 2012 21:40:15 +0000

s3m testcase

Diffstat:
Msrc/plugins/Makefile.am | 9++++++++-
Msrc/plugins/test_gif.c | 2+-
Asrc/plugins/test_s3m.c | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am @@ -24,7 +24,8 @@ EXTRA_DIST = template_extractor.c \ testdata/mpeg_melt.mpg \ testdata/wav_noise.wav \ testdata/wav_alert.wav \ - testdata/it_dawn.it + testdata/it_dawn.it \ + testdata/s3m_2nd_pm.s3m if HAVE_VORBISFILE PLUGIN_OGG=libextractor_ogg.la @@ -88,6 +89,7 @@ endif check_PROGRAMS = \ test_wav \ test_it \ + test_s3m \ $(TEST_OGG) \ $(TEST_MIME) \ $(TEST_GIF) \ @@ -133,6 +135,11 @@ libextractor_s3m_la_SOURCES = \ libextractor_s3m_la_LDFLAGS = \ $(PLUGINFLAGS) +test_s3m_SOURCES = \ + test_s3m.c +test_s3m_LDADD = \ + $(top_builddir)/src/plugins/libtest.la + libextractor_wav_la_SOURCES = \ wav_extractor.c diff --git a/src/plugins/test_gif.c b/src/plugins/test_gif.c @@ -19,7 +19,7 @@ */ /** * @file plugins/test_gif.c - * @brief testcase for ogg plugin + * @brief testcase for gif plugin * @author Christian Grothoff */ #include "platform.h" diff --git a/src/plugins/test_s3m.c b/src/plugins/test_s3m.c @@ -0,0 +1,69 @@ +/* + This file is part of libextractor. + (C) 2012 Vidyut Samanta and Christian Grothoff + + libextractor is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + libextractor is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with libextractor; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +/** + * @file plugins/test_s3m.c + * @brief testcase for s3m plugin + * @author Christian Grothoff + */ +#include "platform.h" +#include "test_lib.h" + + + +/** + * Main function for the S3M testcase. + * + * @param argc number of arguments (ignored) + * @param argv arguments (ignored) + * @return 0 on success + */ +int +main (int argc, char *argv[]) +{ + struct SolutionData s3m_2ndpm_sol[] = + { + { + EXTRACTOR_METATYPE_MIMETYPE, + EXTRACTOR_METAFORMAT_UTF8, + "text/plain", + "audio/x-s3m", + strlen ("audio/x-s3m") + 1, + 0 + }, + { + EXTRACTOR_METATYPE_TITLE, + EXTRACTOR_METAFORMAT_UTF8, + "text/plain", + "UnreaL ][ / PM ", + strlen ("UnreaL ][ / PM ") + 1, + 0 + }, + { 0, 0, NULL, NULL, 0, -1 } + }; + struct ProblemSet ps[] = + { + { "testdata/s3m_2nd_pm.s3m", + s3m_2ndpm_sol }, + { NULL, NULL } + }; + return ET_main ("s3m", ps); +} + +/* end of test_s3m.c */