[easytag] Fix file description test with missing tag support



commit d1ca2a10518efccbc4a1613adf053c2710ce9b26
Author: David King <amigadave amigadave com>
Date:   Mon Jun 1 17:16:32 2015 +0100

    Fix file description test with missing tag support
    
    If support for a particular tag type is disabled, test that the file/tag
    type is tested against the unsupported type.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749983

 tests/test-file_description.c |   87 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 80 insertions(+), 7 deletions(-)
---
diff --git a/tests/test-file_description.c b/tests/test-file_description.c
index 7f7cb78..87c70ec 100644
--- a/tests/test-file_description.c
+++ b/tests/test-file_description.c
@@ -1,5 +1,5 @@
 /* EasyTAG - tag editor for audio files
- * Copyright (C) 2014 David King <amigadave amigadave com>
+ * Copyright (C) 2014-2015 David King <amigadave amigadave com>
  *
  * This program 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
@@ -16,6 +16,8 @@
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+#include "config.h"
+
 #include "file_description.h"
 
 static void
@@ -55,21 +57,57 @@ file_description_get_file_description (void)
         ET_Tag_Type tag_type;
     } filenames[] =
     {
+#ifdef ENABLE_MP3
         { "test.mp3", MP3_FILE, ID3_TAG },
         { "test.mp4.mp3", MP3_FILE, ID3_TAG },
+        { "test.mp2", MP2_FILE, ID3_TAG },
+#else /* !ENABLE_MP3 */
+        { "test.mp3", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.mp4.mp3", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.mp2", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif /* !ENABLE_MP3 */
         { "test.mp4mp3", UNKNOWN_FILE, UNKNOWN_TAG },
         { "test.", UNKNOWN_FILE, UNKNOWN_TAG },
         { "test", UNKNOWN_FILE, UNKNOWN_TAG },
+#ifdef ENABLE_MP4
         { "test.Mp4", MP4_FILE, MP4_TAG },
+        { "test.mp4", MP4_FILE, MP4_TAG },
+        { "test.m4a", MP4_FILE, MP4_TAG },
+        { "test.m4p", MP4_FILE, MP4_TAG },
+        { "test.m4v", MP4_FILE, MP4_TAG },
+#else /* !ENABLE_MP4 */
+        { "test.Mp4", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.mp4", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.m4a", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.m4p", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.m4v", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif /* ENABLE_MP4 */
         { "test.mpeg", UNKNOWN_FILE, UNKNOWN_TAG },
-        { "test.mp2", MP2_FILE, ID3_TAG },
+#ifdef ENABLE_OPUS
         { "test.opus", OPUS_FILE, OPUS_TAG },
+#else /* !ENABLE_OPUS */
+        { "test.opus", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif /* !ENABLE_OPUS */
+#ifdef ENABLE_OGG
         { "test.ogg", OGG_FILE, OGG_TAG },
         { "test.oga", OGG_FILE, OGG_TAG },
+#else /* !ENABLE_OGG */
+        { "test.ogg", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.oga", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif /* !ENABLE_OGG */
+#ifdef ENABLE_SPEEX
         { "test.spx", SPEEX_FILE, OGG_TAG },
+#else /* !ENABLE_SPEEX */
+        { "test.spx", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif
         { "test.dsf", UNKNOWN_FILE, UNKNOWN_TAG },
+#ifdef ENABLE_FLAC
         { "test.flac", FLAC_FILE, FLAC_TAG },
         { "test.fla", FLAC_FILE, FLAC_TAG },
+#else /* !ENABLE_FLAC */
+        { "test.flac", UNKNOWN_FILE, UNKNOWN_TAG },
+        { "test.fla", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif /* !ENABLE_FLAC */
         { "test.mpc", MPC_FILE, APE_TAG },
         { "test.mp+", MPC_FILE, APE_TAG },
         { "test.mpp", MPC_FILE, APE_TAG },
@@ -77,11 +115,11 @@ file_description_get_file_description (void)
         { "test.mac", MAC_FILE, APE_TAG },
         { "test.ofr", OFR_FILE, APE_TAG },
         { "test.ofs", OFR_FILE, APE_TAG },
-        { "test.mp4", MP4_FILE, MP4_TAG },
-        { "test.m4a", MP4_FILE, MP4_TAG },
-        { "test.m4p", MP4_FILE, MP4_TAG },
-        { "test.m4v", MP4_FILE, MP4_TAG },
+#ifdef ENABLE_WAVPACK
         { "test.wv", WAVPACK_FILE, WAVPACK_TAG },
+#else /* !ENABLE_WAVPACK */
+        { "test.wv", UNKNOWN_FILE, UNKNOWN_TAG },
+#endif /* !ENABLE_WAVPACK */
         { "test.wvc", UNKNOWN_FILE, UNKNOWN_TAG }
     };
 
@@ -104,19 +142,43 @@ file_description_is_supported (void)
         gboolean supported;
     } filenames[] =
     {
+#ifdef ENABLE_MP3
         { "test.mp3", TRUE },
         { "test.mp4.mp3", TRUE },
+        { "test.mp2", TRUE },
+#else /* !ENABLE_MP3 */
+        { "test.mp3", FALSE },
+        { "test.mp4.mp3", FALSE },
+        { "test.mp2", FALSE },
+#endif /* !ENABLE_MP3 */
         { "test.mp4mp3", FALSE },
         { "test.", FALSE },
         { "test", FALSE },
         { "test.mpeg", FALSE },
-        { "test.mp2", TRUE },
+#ifdef ENABLE_OPUS
         { "test.opus", TRUE },
+#else /* !ENABLE_OPUS */
+        { "test.opus", FALSE },
+#endif /* !ENABLE_OPUS */
+#ifdef ENABLE_OGG
         { "test.ogg", TRUE },
         { "test.oga", TRUE },
+#else /* !ENABLE_OGG */
+        { "test.ogg", FALSE },
+        { "test.oga", FALSE },
+#endif /* !ENABLE_OGG */
+#ifdef ENABLE_SPEEX
         { "test.spx", TRUE },
+#else /* !ENABLE_SPEEX */
+        { "test.spx", FALSE },
+#endif /* !ENABLE_SPEEX */
+#ifdef ENABLE_FLAC
         { "test.flac", TRUE },
         { "test.fla", TRUE },
+#else /* !ENABLE_FLAC */
+        { "test.flac", FALSE },
+        { "test.fla", FALSE },
+#endif /* !ENABLE_FLAC */
         { "test.mpc", TRUE },
         { "test.mp+", TRUE },
         { "test.mpp", TRUE },
@@ -124,11 +186,22 @@ file_description_is_supported (void)
         { "test.mac", TRUE },
         { "test.ofr", TRUE },
         { "test.ofs", TRUE },
+#ifdef ENABLE_MP4
         { "test.mp4", TRUE },
         { "test.m4a", TRUE },
         { "test.m4p", TRUE },
         { "test.m4v", TRUE },
+#else /* !ENABLE_MP4 */
+        { "test.mp4", FALSE },
+        { "test.m4a", FALSE },
+        { "test.m4p", FALSE },
+        { "test.m4v", FALSE },
+#endif /* !ENABLE_MP4 */
+#ifdef ENABLE_WAVPACK
         { "test.wv", TRUE },
+#else /* !ENABLE_WAVPACK */
+        { "test.wv", FALSE },
+#endif /* !ENABLE_WAVPACK */
         { "test.wvc", FALSE }
     };
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]