test_wav.c (2285B)
1 /* 2 This file is part of libextractor. 3 Copyright (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., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19 */ 20 /** 21 * @file plugins/test_wav.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 * Main function for the WAV 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 wav_noise_sol[] = { 40 { 41 EXTRACTOR_METATYPE_MIMETYPE, 42 EXTRACTOR_METAFORMAT_UTF8, 43 "text/plain", 44 "audio/x-wav", 45 strlen ("audio/x-wav") + 1, 46 0 47 }, 48 { 49 EXTRACTOR_METATYPE_RESOURCE_TYPE, 50 EXTRACTOR_METAFORMAT_UTF8, 51 "text/plain", 52 "1000 ms, 48000 Hz, mono", 53 strlen ("1000 ms, 48000 Hz, mono") + 1, 54 0 55 }, 56 { 0, 0, NULL, NULL, 0, -1 } 57 }; 58 struct SolutionData wav_alert_sol[] = { 59 { 60 EXTRACTOR_METATYPE_MIMETYPE, 61 EXTRACTOR_METAFORMAT_UTF8, 62 "text/plain", 63 "audio/x-wav", 64 strlen ("audio/x-wav") + 1, 65 0 66 }, 67 { 68 EXTRACTOR_METATYPE_RESOURCE_TYPE, 69 EXTRACTOR_METAFORMAT_UTF8, 70 "text/plain", 71 "525 ms, 22050 Hz, mono", 72 strlen ("525 ms, 22050 Hz, mono") + 1, 73 0 74 }, 75 { 0, 0, NULL, NULL, 0, -1 } 76 }; 77 struct ProblemSet ps[] = { 78 { "testdata/wav_noise.wav", 79 wav_noise_sol }, 80 { "testdata/wav_alert.wav", 81 wav_alert_sol }, 82 { NULL, NULL } 83 }; 84 return ET_main ("wav", ps); 85 } 86 87 88 /* end of test_wav.c */