mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 13:34:19 -04:00
Compile time configuration of supported formats (#1262)
CMake options WITH_APE, WITH_ASF, WITH_DSF, WITH_MOD, WITH_MP4, WITH_RIFF, WITH_SHORTEN, WITH_TRUEAUDIO, WITH_VORBIS, by default, they are all ON.
This commit is contained in:
@ -1,34 +1,71 @@
|
||||
INCLUDE_DIRECTORIES(
|
||||
SET(test_HDR_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../bindings/c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/asf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2/frames
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mp4
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/riff
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/riff/aiff
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/riff/wav
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/trueaudio
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/vorbis
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/flac
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/speex
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/opus
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/flac
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/wavpack
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mod
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/s3m
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/it
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/xm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/dsf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/dsdiff
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/shorten
|
||||
)
|
||||
IF(WITH_APE)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/wavpack
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_ASF)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/asf
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_MP4)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mp4
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_RIFF)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/riff
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/riff/aiff
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/riff/wav
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_TRUEAUDIO)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/trueaudio
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_VORBIS)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/vorbis
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/flac
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/speex
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ogg/opus
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/flac
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_MOD)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mod
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/s3m
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/it
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/xm
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_DSF)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/dsf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/dsdiff
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_SHORTEN)
|
||||
SET(test_HDR_DIRS ${test_HDR_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/shorten
|
||||
)
|
||||
ENDIF()
|
||||
INCLUDE_DIRECTORIES(${test_HDR_DIRS})
|
||||
|
||||
SET(test_runner_SRCS
|
||||
main.cpp
|
||||
@ -36,7 +73,6 @@ SET(test_runner_SRCS
|
||||
test_map.cpp
|
||||
test_mpeg.cpp
|
||||
test_synchdata.cpp
|
||||
test_trueaudio.cpp
|
||||
test_bytevector.cpp
|
||||
test_bytevectorlist.cpp
|
||||
test_bytevectorstream.cpp
|
||||
@ -49,36 +85,73 @@ SET(test_runner_SRCS
|
||||
test_id3v1.cpp
|
||||
test_id3v2.cpp
|
||||
test_id3v2framefactory.cpp
|
||||
test_xiphcomment.cpp
|
||||
test_aiff.cpp
|
||||
test_riff.cpp
|
||||
test_ogg.cpp
|
||||
test_oggflac.cpp
|
||||
test_flac.cpp
|
||||
test_flacpicture.cpp
|
||||
test_flacunknownmetadatablock.cpp
|
||||
test_ape.cpp
|
||||
test_apetag.cpp
|
||||
test_wav.cpp
|
||||
test_info.cpp
|
||||
test_wavpack.cpp
|
||||
test_mp4.cpp
|
||||
test_mp4item.cpp
|
||||
test_mp4coverart.cpp
|
||||
test_asf.cpp
|
||||
test_mod.cpp
|
||||
test_s3m.cpp
|
||||
test_it.cpp
|
||||
test_xm.cpp
|
||||
test_mpc.cpp
|
||||
test_opus.cpp
|
||||
test_speex.cpp
|
||||
test_dsf.cpp
|
||||
test_dsdiff.cpp
|
||||
test_shorten.cpp
|
||||
test_sizes.cpp
|
||||
test_versionnumber.cpp
|
||||
)
|
||||
IF(WITH_TRUEAUDIO)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_trueaudio.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_VORBIS)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_xiphcomment.cpp
|
||||
test_ogg.cpp
|
||||
test_oggflac.cpp
|
||||
test_flac.cpp
|
||||
test_flacpicture.cpp
|
||||
test_flacunknownmetadatablock.cpp
|
||||
test_opus.cpp
|
||||
test_speex.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_RIFF)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_aiff.cpp
|
||||
test_riff.cpp
|
||||
test_wav.cpp
|
||||
test_info.cpp
|
||||
)
|
||||
ENDIF()
|
||||
if(WITH_APE)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_ape.cpp
|
||||
test_apetag.cpp
|
||||
test_wavpack.cpp
|
||||
test_mpc.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_MP4)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_mp4.cpp
|
||||
test_mp4item.cpp
|
||||
test_mp4coverart.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_ASF)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_asf.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_MOD)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_mod.cpp
|
||||
test_s3m.cpp
|
||||
test_it.cpp
|
||||
test_xm.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_DSF)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_dsf.cpp
|
||||
test_dsdiff.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(WITH_SHORTEN)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_shorten.cpp
|
||||
)
|
||||
ENDIF()
|
||||
IF(BUILD_BINDINGS)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
test_tag_c.cpp
|
||||
|
@ -23,21 +23,30 @@
|
||||
* http://www.mozilla.org/MPL/ *
|
||||
***************************************************************************/
|
||||
|
||||
#include "asfpicture.h"
|
||||
#include "flacpicture.h"
|
||||
#include "flacfile.h"
|
||||
#include "taglib_config.h"
|
||||
#include "tbytevector.h"
|
||||
#include "tvariant.h"
|
||||
#include "tzlib.h"
|
||||
#include "fileref.h"
|
||||
#include "apetag.h"
|
||||
#include "asftag.h"
|
||||
#include "mp4tag.h"
|
||||
#include "xiphcomment.h"
|
||||
#include "id3v1tag.h"
|
||||
#include "id3v2tag.h"
|
||||
#include "attachedpictureframe.h"
|
||||
#include "generalencapsulatedobjectframe.h"
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
#include "asfpicture.h"
|
||||
#include "asftag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
#include "flacpicture.h"
|
||||
#include "flacfile.h"
|
||||
#include "xiphcomment.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
#include "apetag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
#include "mp4tag.h"
|
||||
#endif
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "utils.h"
|
||||
|
||||
@ -69,17 +78,25 @@ class TestComplexProperties : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestComplexProperties);
|
||||
CPPUNIT_TEST(testReadMp3Picture);
|
||||
CPPUNIT_TEST(testSetGetId3Geob);
|
||||
CPPUNIT_TEST(testSetGetId3Picture);
|
||||
CPPUNIT_TEST(testNonExistent);
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
CPPUNIT_TEST(testReadM4aPicture);
|
||||
CPPUNIT_TEST(testSetGetMp4Picture);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_TEST(testReadOggPicture);
|
||||
CPPUNIT_TEST(testReadWriteFlacPicture);
|
||||
CPPUNIT_TEST(testReadWriteMultipleProperties);
|
||||
CPPUNIT_TEST(testSetGetId3Geob);
|
||||
CPPUNIT_TEST(testSetGetId3Picture);
|
||||
CPPUNIT_TEST(testSetGetApePicture);
|
||||
CPPUNIT_TEST(testSetGetAsfPicture);
|
||||
CPPUNIT_TEST(testSetGetMp4Picture);
|
||||
CPPUNIT_TEST(testSetGetXiphPicture);
|
||||
CPPUNIT_TEST(testNonExistent);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_TEST(testSetGetApePicture);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
CPPUNIT_TEST(testSetGetAsfPicture);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -103,6 +120,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
void testReadM4aPicture()
|
||||
{
|
||||
const ByteVector expectedData1(
|
||||
@ -145,7 +163,9 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"),
|
||||
picture.value("mimeType").value<String>());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testReadOggPicture()
|
||||
{
|
||||
FileRef f(TEST_FILE_PATH_C("lowercase-fields.ogg"), false);
|
||||
@ -217,6 +237,7 @@ public:
|
||||
CPPUNIT_ASSERT(f.pictureList().isEmpty());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void testReadWriteMultipleProperties()
|
||||
{
|
||||
@ -311,6 +332,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::FrontCover, frame->type());
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
void testSetGetApePicture()
|
||||
{
|
||||
const String FRONT_COVER("COVER ART (FRONT)");
|
||||
@ -326,7 +348,9 @@ public:
|
||||
.append(picture.value("data").value<ByteVector>()),
|
||||
item.binaryData());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
void testSetGetAsfPicture()
|
||||
{
|
||||
VariantMap picture(TEST_PICTURE);
|
||||
@ -344,7 +368,9 @@ public:
|
||||
asfPicture.description());
|
||||
CPPUNIT_ASSERT_EQUAL(ASF::Picture::FrontCover, asfPicture.type());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
void testSetGetMp4Picture()
|
||||
{
|
||||
VariantMap picture(TEST_PICTURE);
|
||||
@ -360,7 +386,9 @@ public:
|
||||
covr.data());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, covr.format());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testSetGetXiphPicture()
|
||||
{
|
||||
VariantMap picture(TEST_PICTURE);
|
||||
@ -386,6 +414,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(1, pic->width());
|
||||
CPPUNIT_ASSERT_EQUAL(1, pic->height());
|
||||
}
|
||||
#endif
|
||||
|
||||
void testNonExistent()
|
||||
{
|
||||
|
@ -26,27 +26,44 @@
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
|
||||
#include "taglib_config.h"
|
||||
#include "tfilestream.h"
|
||||
#include "tbytevectorstream.h"
|
||||
#include "tag.h"
|
||||
#include "fileref.h"
|
||||
#include "mpegfile.h"
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
#include "oggflacfile.h"
|
||||
#include "vorbisfile.h"
|
||||
#include "mpegfile.h"
|
||||
#include "mpcfile.h"
|
||||
#include "asffile.h"
|
||||
#include "speexfile.h"
|
||||
#include "flacfile.h"
|
||||
#include "trueaudiofile.h"
|
||||
#include "mp4file.h"
|
||||
#include "wavfile.h"
|
||||
#include "apefile.h"
|
||||
#include "aifffile.h"
|
||||
#include "wavpackfile.h"
|
||||
#include "opusfile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
#include "mpcfile.h"
|
||||
#include "apefile.h"
|
||||
#include "wavpackfile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
#include "asffile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
#include "trueaudiofile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
#include "mp4file.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
#include "wavfile.h"
|
||||
#include "aifffile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MOD
|
||||
#include "xmfile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
#include "dsffile.h"
|
||||
#include "dsdifffile.h"
|
||||
#endif
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "utils.h"
|
||||
|
||||
@ -55,6 +72,7 @@ using namespace TagLib;
|
||||
|
||||
namespace
|
||||
{
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
class DummyResolver : public FileRef::FileTypeResolver
|
||||
{
|
||||
public:
|
||||
@ -63,7 +81,9 @@ namespace
|
||||
return new Ogg::Vorbis::File(fileName);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
class DummyStreamResolver : public FileRef::StreamTypeResolver
|
||||
{
|
||||
public:
|
||||
@ -77,36 +97,51 @@ namespace
|
||||
return new MP4::File(s);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
class TestFileRef : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestFileRef);
|
||||
CPPUNIT_TEST(testASF);
|
||||
CPPUNIT_TEST(testMusepack);
|
||||
CPPUNIT_TEST(testVorbis);
|
||||
CPPUNIT_TEST(testSpeex);
|
||||
CPPUNIT_TEST(testFLAC);
|
||||
CPPUNIT_TEST(testMP3);
|
||||
CPPUNIT_TEST(testOGA_FLAC);
|
||||
CPPUNIT_TEST(testOGA_Vorbis);
|
||||
CPPUNIT_TEST(testMP4_1);
|
||||
CPPUNIT_TEST(testMP4_2);
|
||||
CPPUNIT_TEST(testMP4_3);
|
||||
CPPUNIT_TEST(testMP4_4);
|
||||
CPPUNIT_TEST(testTrueAudio);
|
||||
CPPUNIT_TEST(testAPE);
|
||||
CPPUNIT_TEST(testWav);
|
||||
CPPUNIT_TEST(testAIFF_1);
|
||||
CPPUNIT_TEST(testAIFF_2);
|
||||
CPPUNIT_TEST(testWavPack);
|
||||
CPPUNIT_TEST(testOpus);
|
||||
CPPUNIT_TEST(testDSF);
|
||||
CPPUNIT_TEST(testDSDIFF);
|
||||
CPPUNIT_TEST(testUnsupported);
|
||||
CPPUNIT_TEST(testAudioProperties);
|
||||
CPPUNIT_TEST(testDefaultFileExtensions);
|
||||
CPPUNIT_TEST(testFileResolver);
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
CPPUNIT_TEST(testASF);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_TEST(testMusepack);
|
||||
CPPUNIT_TEST(testAPE);
|
||||
CPPUNIT_TEST(testWavPack);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_TEST(testVorbis);
|
||||
CPPUNIT_TEST(testSpeex);
|
||||
CPPUNIT_TEST(testFLAC);
|
||||
CPPUNIT_TEST(testOGA_FLAC);
|
||||
CPPUNIT_TEST(testOGA_Vorbis);
|
||||
CPPUNIT_TEST(testOpus);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
CPPUNIT_TEST(testMP4_1);
|
||||
CPPUNIT_TEST(testMP4_2);
|
||||
CPPUNIT_TEST(testMP4_3);
|
||||
CPPUNIT_TEST(testMP4_4);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
CPPUNIT_TEST(testTrueAudio);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
CPPUNIT_TEST(testWav);
|
||||
CPPUNIT_TEST(testAIFF_1);
|
||||
CPPUNIT_TEST(testAIFF_2);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
CPPUNIT_TEST(testDSF);
|
||||
CPPUNIT_TEST(testDSDIFF);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -239,16 +274,21 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
void testMusepack()
|
||||
{
|
||||
fileRefSave<MPC::File>("click", ".mpc");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
void testASF()
|
||||
{
|
||||
fileRefSave<ASF::File>("silence-1", ".wma");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testVorbis()
|
||||
{
|
||||
fileRefSave<Ogg::Vorbis::File>("empty", ".ogg");
|
||||
@ -263,17 +303,21 @@ public:
|
||||
{
|
||||
fileRefSave<FLAC::File>("no-tags", ".flac");
|
||||
}
|
||||
#endif
|
||||
|
||||
void testMP3()
|
||||
{
|
||||
fileRefSave<MPEG::File>("xing", ".mp3");
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
void testTrueAudio()
|
||||
{
|
||||
fileRefSave<TrueAudio::File>("empty", ".tta");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
void testMP4_1()
|
||||
{
|
||||
fileRefSave<MP4::File>("has-tags", ".m4a");
|
||||
@ -293,12 +337,16 @@ public:
|
||||
{
|
||||
fileRefSave<MP4::File>("blank_video", ".m4v");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
void testWav()
|
||||
{
|
||||
fileRefSave<RIFF::WAV::File>("empty", ".wav");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testOGA_FLAC()
|
||||
{
|
||||
fileRefSave<Ogg::FLAC::File>("empty_flac", ".oga");
|
||||
@ -308,12 +356,16 @@ public:
|
||||
{
|
||||
fileRefSave<Ogg::Vorbis::File>("empty_vorbis", ".oga");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
void testAPE()
|
||||
{
|
||||
fileRefSave<APE::File>("mac-399", ".ape");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
void testAIFF_1()
|
||||
{
|
||||
fileRefSave<RIFF::AIFF::File>("empty", ".aiff");
|
||||
@ -323,17 +375,23 @@ public:
|
||||
{
|
||||
fileRefSave<RIFF::AIFF::File>("alaw", ".aifc");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
void testWavPack()
|
||||
{
|
||||
fileRefSave<WavPack::File>("click", ".wv");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testOpus()
|
||||
{
|
||||
fileRefSave<Ogg::Opus::File>("correctness_gain_silent_output", ".opus");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
void testDSF()
|
||||
{
|
||||
fileRefSave<DSF::File>("empty10ms",".dsf");
|
||||
@ -343,6 +401,7 @@ public:
|
||||
{
|
||||
fileRefSave<DSDIFF::File>("empty10ms",".dff");
|
||||
}
|
||||
#endif
|
||||
|
||||
void testUnsupported()
|
||||
{
|
||||
@ -364,28 +423,56 @@ public:
|
||||
void testDefaultFileExtensions()
|
||||
{
|
||||
const StringList extensions = FileRef::defaultFileExtensions();
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_ASSERT(extensions.contains("mpc"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
CPPUNIT_ASSERT(extensions.contains("wma"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_ASSERT(extensions.contains("ogg"));
|
||||
CPPUNIT_ASSERT(extensions.contains("spx"));
|
||||
CPPUNIT_ASSERT(extensions.contains("flac"));
|
||||
#endif
|
||||
CPPUNIT_ASSERT(extensions.contains("mp3"));
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
CPPUNIT_ASSERT(extensions.contains("tta"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
CPPUNIT_ASSERT(extensions.contains("m4a"));
|
||||
CPPUNIT_ASSERT(extensions.contains("3g2"));
|
||||
CPPUNIT_ASSERT(extensions.contains("m4v"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
CPPUNIT_ASSERT(extensions.contains("wav"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_ASSERT(extensions.contains("oga"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_ASSERT(extensions.contains("ape"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
CPPUNIT_ASSERT(extensions.contains("aiff"));
|
||||
CPPUNIT_ASSERT(extensions.contains("aifc"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_ASSERT(extensions.contains("wv"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_ASSERT(extensions.contains("opus"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MOD
|
||||
CPPUNIT_ASSERT(extensions.contains("xm"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
CPPUNIT_ASSERT(extensions.contains("dsf"));
|
||||
CPPUNIT_ASSERT(extensions.contains("dff"));
|
||||
CPPUNIT_ASSERT(extensions.contains("dsdiff"));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_SHORTEN
|
||||
CPPUNIT_ASSERT(extensions.contains("shn"));
|
||||
#endif
|
||||
}
|
||||
|
||||
void testFileResolver()
|
||||
@ -395,6 +482,7 @@ public:
|
||||
CPPUNIT_ASSERT(dynamic_cast<MPEG::File *>(f.file()) != nullptr);
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
DummyResolver resolver;
|
||||
FileRef::addFileTypeResolver(&resolver);
|
||||
|
||||
@ -402,7 +490,9 @@ public:
|
||||
FileRef f(TEST_FILE_PATH_C("xing.mp3"));
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f.file()) != nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
DummyStreamResolver streamResolver;
|
||||
FileRef::addFileTypeResolver(&streamResolver);
|
||||
|
||||
@ -411,6 +501,7 @@ public:
|
||||
FileRef f(&s);
|
||||
CPPUNIT_ASSERT(dynamic_cast<MP4::File *>(f.file()) != nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
FileRef::clearFileTypeResolvers();
|
||||
}
|
||||
|
@ -26,21 +26,30 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include "flacproperties.h"
|
||||
#include "taglib_config.h"
|
||||
#include "mpegproperties.h"
|
||||
#include "tbytevector.h"
|
||||
#include "tpropertymap.h"
|
||||
#include "mpegfile.h"
|
||||
#include "flacfile.h"
|
||||
#include "trueaudiofile.h"
|
||||
#include "trueaudioproperties.h"
|
||||
#include "wavfile.h"
|
||||
#include "aifffile.h"
|
||||
#include "dsffile.h"
|
||||
#include "dsdifffile.h"
|
||||
#include "id3v2tag.h"
|
||||
#include "id3v2frame.h"
|
||||
#include "id3v2framefactory.h"
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
#include "flacproperties.h"
|
||||
#include "flacfile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
#include "trueaudiofile.h"
|
||||
#include "trueaudioproperties.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
#include "wavfile.h"
|
||||
#include "aifffile.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
#include "dsffile.h"
|
||||
#include "dsdifffile.h"
|
||||
#endif
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "utils.h"
|
||||
|
||||
@ -118,12 +127,20 @@ class TestId3v2FrameFactory : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestId3v2FrameFactory);
|
||||
CPPUNIT_TEST(testMPEG);
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_TEST(testFLAC);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
CPPUNIT_TEST(testTrueAudio);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
CPPUNIT_TEST(testWAV);
|
||||
CPPUNIT_TEST(testAIFF);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
CPPUNIT_TEST(testDSF);
|
||||
CPPUNIT_TEST(testDSDIFF);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -236,6 +253,7 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testFLAC()
|
||||
{
|
||||
ScopedFileCopy copy("no-tags", ".flac");
|
||||
@ -260,7 +278,9 @@ public:
|
||||
}
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
void testTrueAudio()
|
||||
{
|
||||
ScopedFileCopy copy("empty", ".tta");
|
||||
@ -285,7 +305,9 @@ public:
|
||||
}
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
void testWAV()
|
||||
{
|
||||
ScopedFileCopy copy("empty", ".wav");
|
||||
@ -335,7 +357,9 @@ public:
|
||||
}
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
void testDSF()
|
||||
{
|
||||
ScopedFileCopy copy("empty10ms", ".dsf");
|
||||
@ -385,6 +409,7 @@ public:
|
||||
}
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
@ -27,12 +27,15 @@
|
||||
#include <cstdio>
|
||||
#include <array>
|
||||
|
||||
#include "taglib_config.h"
|
||||
#include "tstring.h"
|
||||
#include "tpropertymap.h"
|
||||
#include "mpegfile.h"
|
||||
#include "id3v2tag.h"
|
||||
#include "id3v1tag.h"
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
#include "apetag.h"
|
||||
#endif
|
||||
#include "mpegproperties.h"
|
||||
#include "xingheader.h"
|
||||
#include "mpegheader.h"
|
||||
@ -67,7 +70,9 @@ class TestMPEG : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testRepeatedSave3);
|
||||
CPPUNIT_TEST(testEmptyID3v2);
|
||||
CPPUNIT_TEST(testEmptyID3v1);
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_TEST(testEmptyAPE);
|
||||
#endif
|
||||
CPPUNIT_TEST(testIgnoreGarbage);
|
||||
CPPUNIT_TEST(testExtendedHeader);
|
||||
CPPUNIT_TEST(testReadStyleFast);
|
||||
@ -304,7 +309,9 @@ public:
|
||||
{
|
||||
MPEG::File f(copy.fileName().c_str());
|
||||
f.ID3v2Tag(true)->setTitle("ID3v2");
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
f.APETag(true)->setTitle("APE");
|
||||
#endif
|
||||
f.ID3v1Tag(true)->setTitle("ID3v1");
|
||||
f.save();
|
||||
}
|
||||
@ -312,8 +319,10 @@ public:
|
||||
MPEG::File f(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(String("ID3v2"), f.properties()["TITLE"].front());
|
||||
f.strip(MPEG::File::ID3v2);
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_ASSERT_EQUAL(String("APE"), f.properties()["TITLE"].front());
|
||||
f.strip(MPEG::File::APE);
|
||||
#endif
|
||||
CPPUNIT_ASSERT_EQUAL(String("ID3v1"), f.properties()["TITLE"].front());
|
||||
f.strip(MPEG::File::ID3v1);
|
||||
CPPUNIT_ASSERT(f.properties().isEmpty());
|
||||
@ -464,17 +473,23 @@ public:
|
||||
CPPUNIT_ASSERT(!f.hasAPETag());
|
||||
CPPUNIT_ASSERT(!f.hasID3v1Tag());
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
f.APETag(true)->setTitle("01234 56789 ABCDE FGHIJ");
|
||||
f.save();
|
||||
f.APETag()->setTitle("0");
|
||||
f.save();
|
||||
#endif
|
||||
f.ID3v1Tag(true)->setTitle("01234 56789 ABCDE FGHIJ");
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
f.APETag()->setTitle("01234 56789 ABCDE FGHIJ 01234 56789 ABCDE FGHIJ 01234 56789");
|
||||
#endif
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
MPEG::File f(copy.fileName().c_str());
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_ASSERT(f.hasAPETag());
|
||||
#endif
|
||||
CPPUNIT_ASSERT(f.hasID3v1Tag());
|
||||
}
|
||||
}
|
||||
@ -519,6 +534,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
void testEmptyAPE()
|
||||
{
|
||||
ScopedFileCopy copy("xing", ".mp3");
|
||||
@ -538,6 +554,7 @@ public:
|
||||
CPPUNIT_ASSERT(!f.hasAPETag());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void testIgnoreGarbage()
|
||||
{
|
||||
|
@ -23,15 +23,26 @@
|
||||
* http://www.mozilla.org/MPL/ *
|
||||
***************************************************************************/
|
||||
|
||||
#include "taglib_config.h"
|
||||
#include "tpropertymap.h"
|
||||
#include "tag.h"
|
||||
#include "apetag.h"
|
||||
#include "asftag.h"
|
||||
#include "id3v1tag.h"
|
||||
#include "id3v2tag.h"
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
#include "apetag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
#include "asftag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
#include "infotag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
#include "mp4tag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
#include "xiphcomment.h"
|
||||
#endif
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "utils.h"
|
||||
|
||||
@ -41,14 +52,24 @@ class TestPropertyMap : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestPropertyMap);
|
||||
CPPUNIT_TEST(testInvalidKeys);
|
||||
CPPUNIT_TEST(testGetSetApe);
|
||||
CPPUNIT_TEST(testGetSetAsf);
|
||||
CPPUNIT_TEST(testGetSetId3v1);
|
||||
CPPUNIT_TEST(testGetSetId3v2);
|
||||
CPPUNIT_TEST(testGetSetInfo);
|
||||
CPPUNIT_TEST(testGetSetMp4);
|
||||
CPPUNIT_TEST(testGetSetXiphComment);
|
||||
CPPUNIT_TEST(testGetSet);
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_TEST(testGetSetApe);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
CPPUNIT_TEST(testGetSetAsf);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
CPPUNIT_TEST(testGetSetInfo);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
CPPUNIT_TEST(testGetSetMp4);
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_TEST(testGetSetXiphComment);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -141,30 +162,40 @@ public:
|
||||
tagGetSet<ID3v2::Tag>();
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testGetSetXiphComment()
|
||||
{
|
||||
tagGetSet<Ogg::XiphComment>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
void testGetSetApe()
|
||||
{
|
||||
tagGetSet<APE::Tag>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
void testGetSetAsf()
|
||||
{
|
||||
tagGetSet<ASF::Tag>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
void testGetSetMp4()
|
||||
{
|
||||
tagGetSet<MP4::Tag>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
void testGetSetInfo()
|
||||
{
|
||||
tagGetSet<RIFF::Info::Tag>();
|
||||
}
|
||||
#endif
|
||||
|
||||
void testGetSet()
|
||||
{
|
||||
|
@ -25,34 +25,25 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "aifffile.h"
|
||||
#include "aiffproperties.h"
|
||||
#include "apefile.h"
|
||||
#include "apefooter.h"
|
||||
#include "apeitem.h"
|
||||
#include "apeproperties.h"
|
||||
#include "apetag.h"
|
||||
#include "asfattribute.h"
|
||||
#include "asffile.h"
|
||||
#include "asfpicture.h"
|
||||
#include "asfproperties.h"
|
||||
#include "asftag.h"
|
||||
#include "attachedpictureframe.h"
|
||||
#include "audioproperties.h"
|
||||
#include "chapterframe.h"
|
||||
#include "commentsframe.h"
|
||||
#include "dsffile.h"
|
||||
#include "dsfproperties.h"
|
||||
#include "dsdifffile.h"
|
||||
#include "dsdiffproperties.h"
|
||||
#include "eventtimingcodesframe.h"
|
||||
#include "taglib_config.h"
|
||||
#include "tag.h"
|
||||
#include "tbytevector.h"
|
||||
#include "tbytevectorlist.h"
|
||||
#include "tbytevectorstream.h"
|
||||
#include "tdebuglistener.h"
|
||||
#include "tfile.h"
|
||||
#include "tfilestream.h"
|
||||
#include "tiostream.h"
|
||||
#include "tlist.h"
|
||||
#include "tmap.h"
|
||||
#include "tpropertymap.h"
|
||||
#include "tstring.h"
|
||||
#include "tstringlist.h"
|
||||
#include "fileref.h"
|
||||
#include "flacfile.h"
|
||||
#include "flacmetadatablock.h"
|
||||
#include "flacunknownmetadatablock.h"
|
||||
#include "flacpicture.h"
|
||||
#include "flacproperties.h"
|
||||
#include "generalencapsulatedobjectframe.h"
|
||||
#include "mpegfile.h"
|
||||
#include "mpegheader.h"
|
||||
#include "mpegproperties.h"
|
||||
#include "xingheader.h"
|
||||
#include "id3v1tag.h"
|
||||
#include "id3v2extendedheader.h"
|
||||
#include "id3v2footer.h"
|
||||
@ -60,75 +51,103 @@
|
||||
#include "id3v2framefactory.h"
|
||||
#include "id3v2header.h"
|
||||
#include "id3v2tag.h"
|
||||
#include "attachedpictureframe.h"
|
||||
#include "audioproperties.h"
|
||||
#include "chapterframe.h"
|
||||
#include "commentsframe.h"
|
||||
#include "eventtimingcodesframe.h"
|
||||
#include "generalencapsulatedobjectframe.h"
|
||||
#include "ownershipframe.h"
|
||||
#include "podcastframe.h"
|
||||
#include "popularimeterframe.h"
|
||||
#include "privateframe.h"
|
||||
#include "relativevolumeframe.h"
|
||||
#include "synchronizedlyricsframe.h"
|
||||
#include "tableofcontentsframe.h"
|
||||
#include "textidentificationframe.h"
|
||||
#include "uniquefileidentifierframe.h"
|
||||
#include "unknownframe.h"
|
||||
#include "unsynchronizedlyricsframe.h"
|
||||
#include "urllinkframe.h"
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
#include "aifffile.h"
|
||||
#include "aiffproperties.h"
|
||||
#include "infotag.h"
|
||||
#include "itfile.h"
|
||||
#include "itproperties.h"
|
||||
#include "modfile.h"
|
||||
#include "modfilebase.h"
|
||||
#include "modproperties.h"
|
||||
#include "modtag.h"
|
||||
#include "mp4coverart.h"
|
||||
#include "mp4file.h"
|
||||
#include "mp4item.h"
|
||||
#include "mp4itemfactory.h"
|
||||
#include "mp4properties.h"
|
||||
#include "mp4tag.h"
|
||||
#include "rifffile.h"
|
||||
#include "wavfile.h"
|
||||
#include "wavproperties.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
#include "apefile.h"
|
||||
#include "apefooter.h"
|
||||
#include "apeitem.h"
|
||||
#include "apeproperties.h"
|
||||
#include "apetag.h"
|
||||
#include "mpcfile.h"
|
||||
#include "mpcproperties.h"
|
||||
#include "mpegfile.h"
|
||||
#include "mpegheader.h"
|
||||
#include "mpegproperties.h"
|
||||
#include "wavpackfile.h"
|
||||
#include "wavpackproperties.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
#include "asfattribute.h"
|
||||
#include "asffile.h"
|
||||
#include "asfpicture.h"
|
||||
#include "asfproperties.h"
|
||||
#include "asftag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
#include "dsffile.h"
|
||||
#include "dsfproperties.h"
|
||||
#include "dsdifffile.h"
|
||||
#include "dsdiffproperties.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
#include "flacfile.h"
|
||||
#include "flacmetadatablock.h"
|
||||
#include "flacunknownmetadatablock.h"
|
||||
#include "flacpicture.h"
|
||||
#include "flacproperties.h"
|
||||
#include "oggfile.h"
|
||||
#include "oggflacfile.h"
|
||||
#include "oggpage.h"
|
||||
#include "oggpageheader.h"
|
||||
#include "opusfile.h"
|
||||
#include "opusproperties.h"
|
||||
#include "ownershipframe.h"
|
||||
#include "podcastframe.h"
|
||||
#include "popularimeterframe.h"
|
||||
#include "privateframe.h"
|
||||
#include "relativevolumeframe.h"
|
||||
#include "rifffile.h"
|
||||
#include "speexfile.h"
|
||||
#include "speexproperties.h"
|
||||
#include "vorbisfile.h"
|
||||
#include "vorbisproperties.h"
|
||||
#include "xiphcomment.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MOD
|
||||
#include "itfile.h"
|
||||
#include "itproperties.h"
|
||||
#include "modfile.h"
|
||||
#include "modfilebase.h"
|
||||
#include "modproperties.h"
|
||||
#include "modtag.h"
|
||||
#include "s3mfile.h"
|
||||
#include "s3mproperties.h"
|
||||
#include "xmfile.h"
|
||||
#include "xmproperties.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
#include "mp4coverart.h"
|
||||
#include "mp4file.h"
|
||||
#include "mp4item.h"
|
||||
#include "mp4itemfactory.h"
|
||||
#include "mp4properties.h"
|
||||
#include "mp4tag.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_SHORTEN
|
||||
#include "shortenfile.h"
|
||||
#include "shortenproperties.h"
|
||||
#include "shortentag.h"
|
||||
#include "speexfile.h"
|
||||
#include "speexproperties.h"
|
||||
#include "synchronizedlyricsframe.h"
|
||||
#include "tableofcontentsframe.h"
|
||||
#include "tag.h"
|
||||
#include "tbytevector.h"
|
||||
#include "tbytevectorlist.h"
|
||||
#include "tbytevectorstream.h"
|
||||
#include "tdebuglistener.h"
|
||||
#include "textidentificationframe.h"
|
||||
#include "tfile.h"
|
||||
#include "tfilestream.h"
|
||||
#include "tiostream.h"
|
||||
#include "tlist.h"
|
||||
#include "tmap.h"
|
||||
#include "tpropertymap.h"
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
#include "trueaudiofile.h"
|
||||
#include "trueaudioproperties.h"
|
||||
#include "tstring.h"
|
||||
#include "tstringlist.h"
|
||||
#include "uniquefileidentifierframe.h"
|
||||
#include "unknownframe.h"
|
||||
#include "unsynchronizedlyricsframe.h"
|
||||
#include "urllinkframe.h"
|
||||
#include "vorbisfile.h"
|
||||
#include "vorbisproperties.h"
|
||||
#include "wavfile.h"
|
||||
#include "wavpackfile.h"
|
||||
#include "wavpackproperties.h"
|
||||
#include "wavproperties.h"
|
||||
#include "xingheader.h"
|
||||
#include "xiphcomment.h"
|
||||
#include "xmfile.h"
|
||||
#include "xmproperties.h"
|
||||
#endif
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
@ -147,31 +166,11 @@ public:
|
||||
// Class list was built by generating XML docs with Doxygen, and then running:
|
||||
// $ grep kind=\"class\" index.xml | sed -E -e 's/(.*<name>|<\/name>.*)//g'
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::APE::Footer));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::APE::Item));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::ASF::Attribute));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::ASF::Picture));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::AudioProperties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::ByteVector));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, false), sizeof(TagLib::ByteVectorList));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ByteVectorStream));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::DebugListener));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSDIFF::DIIN::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSDIFF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSDIFF::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSF::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::FLAC::MetadataBlock));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::Picture));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::UnknownMetadataBlock));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::FileRef));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::FileRef::FileTypeResolver));
|
||||
@ -207,26 +206,47 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::ID3v2::UserTextIdentificationFrame));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::ID3v2::UserUrlLinkFrame));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::IOStream));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::IT::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::IT::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::List<int>));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MP4::CoverArt));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MP4::Item));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::MP4::ItemFactory));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPC::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPC::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPEG::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MPEG::Header));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPEG::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::MPEG::XingHeader));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::Map<int, int>));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Mod::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::FileBase));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, false), sizeof(TagLib::PropertyMap));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::String));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, false), sizeof(TagLib::StringList));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::Tag));
|
||||
#ifdef TAGLIB_WITH_APE
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::APE::Footer));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, false), sizeof(TagLib::APE::Item));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::APE::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPC::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MPC::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::WavPack::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::WavPack::Properties));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_ASF
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::ASF::Attribute));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::ASF::Picture));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::ASF::Tag));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_DSF
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSDIFF::DIIN::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSDIFF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSDIFF::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::DSF::Properties));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::FLAC::MetadataBlock));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::Picture));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::FLAC::UnknownMetadataBlock));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Ogg::FLAC::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Ogg::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Ogg::Opus::File));
|
||||
@ -238,7 +258,29 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Ogg::Vorbis::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Ogg::Vorbis::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Ogg::XiphComment));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, false), sizeof(TagLib::PropertyMap));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MOD
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::IT::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::IT::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::Mod::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::FileBase));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Mod::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::S3M::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::S3M::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::XM::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::XM::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::Variant));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_MP4
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MP4::CoverArt));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::MP4::Item));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::MP4::ItemFactory));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::MP4::Tag));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_RIFF
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::RIFF::AIFF::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::RIFF::AIFF::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::RIFF::File));
|
||||
@ -246,21 +288,16 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::RIFF::Info::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::RIFF::WAV::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::RIFF::WAV::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::S3M::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::S3M::Properties));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_SHORTEN
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Shorten::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Shorten::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Shorten::Tag));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::String));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, false), sizeof(TagLib::StringList));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(0, true), sizeof(TagLib::Tag));
|
||||
#endif
|
||||
#ifdef TAGLIB_WITH_TRUEAUDIO
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::TrueAudio::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::TrueAudio::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::WavPack::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::WavPack::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(2, true), sizeof(TagLib::XM::File));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::XM::Properties));
|
||||
CPPUNIT_ASSERT_EQUAL(classSize(1, false), sizeof(TagLib::Variant));
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <unordered_map>
|
||||
#include <list>
|
||||
|
||||
#include "taglib_config.h"
|
||||
#include "tag_c.h"
|
||||
#include "tbytevector.h"
|
||||
#include "tstring.h"
|
||||
@ -77,7 +78,9 @@ class TestTagC : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestTagC);
|
||||
CPPUNIT_TEST(testMp3);
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
CPPUNIT_TEST(testStream);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -165,6 +168,7 @@ public:
|
||||
taglib_tag_free_strings();
|
||||
}
|
||||
|
||||
#ifdef TAGLIB_WITH_VORBIS
|
||||
void testStream()
|
||||
{
|
||||
// Only fetch the beginning of a FLAC file
|
||||
@ -233,6 +237,7 @@ public:
|
||||
|
||||
taglib_tag_free_strings();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestTagC);
|
||||
|
Reference in New Issue
Block a user