From a196a663090720ca0f154e63805968fd4ddf03f6 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Tue, 21 Nov 2006 06:39:14 +0000 Subject: [PATCH] fix bug where test would fail if libFLAC not built with ogg support --- src/test_libFLAC++/metadata_manip.cpp | 16 +++++++++------- src/test_libFLAC/metadata_manip.c | 17 ++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/test_libFLAC++/metadata_manip.cpp b/src/test_libFLAC++/metadata_manip.cpp index d526dee..2f4e185 100644 --- a/src/test_libFLAC++/metadata_manip.cpp +++ b/src/test_libFLAC++/metadata_manip.cpp @@ -2192,15 +2192,17 @@ bool test_metadata_file_manipulation() if(!test_level_2_misc_(/*is_ogg=*/false)) return false; - if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/true)) /* filename-based */ - return false; - if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/true)) /* callback-based */ - return false; + if(FLAC_API_SUPPORTS_OGG_FLAC) { + if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/true)) /* filename-based */ + return false; + if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/true)) /* callback-based */ + return false; #if 0 - /* when ogg flac write is supported, will have to add this: */ - if(!test_level_2_misc_(/*is_ogg=*/true)) - return false; + /* when ogg flac write is supported, will have to add this: */ + if(!test_level_2_misc_(/*is_ogg=*/true)) + return false; #endif + } return true; } diff --git a/src/test_libFLAC/metadata_manip.c b/src/test_libFLAC/metadata_manip.c index 8d6b4a8..6a1cc52 100644 --- a/src/test_libFLAC/metadata_manip.c +++ b/src/test_libFLAC/metadata_manip.c @@ -22,6 +22,7 @@ #include #include /* for malloc() */ +#include /* for memcpy()/memset() */ #if defined _MSC_VER || defined __MINGW32__ #include /* for utime() */ #include /* for chmod() */ @@ -2111,15 +2112,17 @@ FLAC__bool test_metadata_file_manipulation() if(!test_level_2_misc_(/*is_ogg=*/false)) return false; - if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/true)) /* filename-based */ - return false; - if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/true)) /* callback-based */ - return false; + if(FLAC_API_SUPPORTS_OGG_FLAC) { + if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/true)) /* filename-based */ + return false; + if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/true)) /* callback-based */ + return false; #if 0 - /* when ogg flac write is supported, will have to add this: */ - if(!test_level_2_misc_(/*is_ogg=*/true)) - return false; + /* when ogg flac write is supported, will have to add this: */ + if(!test_level_2_misc_(/*is_ogg=*/true)) + return false; #endif + } return true; } -- 2.7.4