From: Josh Coalson Date: Tue, 21 Nov 2006 06:39:14 +0000 (+0000) Subject: fix bug where test would fail if libFLAC not built with ogg support X-Git-Tag: 1.2.0~250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a196a663090720ca0f154e63805968fd4ddf03f6;p=platform%2Fupstream%2Fflac.git fix bug where test would fail if libFLAC not built with ogg support --- 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; }