mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Support for reading/writing tags from Monkey's Audio files
Patch by Alex Novichkov, slightly modified by me (code formatting + tests). git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1145554 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -3,6 +3,7 @@ if(BUILD_TESTS)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
|
||||
${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
|
||||
@ -37,6 +38,7 @@ SET(test_runner_SRCS
|
||||
test_ogg.cpp
|
||||
test_oggflac.cpp
|
||||
test_flac.cpp
|
||||
test_ape.cpp
|
||||
)
|
||||
IF(WITH_MP4)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
|
@ -2,6 +2,7 @@ INCLUDES = \
|
||||
-I$(top_srcdir)/taglib\
|
||||
-I$(top_srcdir)/taglib/toolkit \
|
||||
-I$(top_srcdir)/taglib/trueaudio \
|
||||
-I$(top_srcdir)/taglib/ape \
|
||||
-I$(top_srcdir)/taglib/mpeg \
|
||||
-I$(top_srcdir)/taglib/mpeg/id3v1 \
|
||||
-I$(top_srcdir)/taglib/mpeg/id3v2 \
|
||||
@ -19,6 +20,7 @@ test_runner_SOURCES = \
|
||||
test_map.cpp \
|
||||
test_mpeg.cpp \
|
||||
test_synchdata.cpp \
|
||||
test_ape.cpp \
|
||||
test_trueaudio.cpp \
|
||||
test_bytevector.cpp \
|
||||
test_string.cpp \
|
||||
|
BIN
tests/data/mac-390-hdr.ape
Normal file
BIN
tests/data/mac-390-hdr.ape
Normal file
Binary file not shown.
BIN
tests/data/mac-396.ape
Normal file
BIN
tests/data/mac-396.ape
Normal file
Binary file not shown.
BIN
tests/data/mac-399.ape
Normal file
BIN
tests/data/mac-399.ape
Normal file
Binary file not shown.
52
tests/test_ape.cpp
Normal file
52
tests/test_ape.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <tag.h>
|
||||
#include <tstringlist.h>
|
||||
#include <tbytevectorlist.h>
|
||||
#include <apefile.h>
|
||||
#include "utils.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace TagLib;
|
||||
|
||||
class TestAPE : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestAPE);
|
||||
CPPUNIT_TEST(testProperties399);
|
||||
CPPUNIT_TEST(testProperties396);
|
||||
CPPUNIT_TEST(testProperties390);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
|
||||
void testProperties399()
|
||||
{
|
||||
APE::File f("data/mac-399.ape");
|
||||
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
|
||||
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
}
|
||||
|
||||
void testProperties396()
|
||||
{
|
||||
APE::File f("data/mac-396.ape");
|
||||
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
|
||||
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
}
|
||||
|
||||
void testProperties390()
|
||||
{
|
||||
APE::File f("data/mac-390-hdr.ape");
|
||||
CPPUNIT_ASSERT_EQUAL(15, f.audioProperties()->length());
|
||||
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestAPE);
|
@ -32,6 +32,7 @@ class TestFileRef : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testMP4_3);
|
||||
#endif
|
||||
CPPUNIT_TEST(testTrueAudio);
|
||||
CPPUNIT_TEST(testAPE);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -148,6 +149,10 @@ public:
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::FLAC::File *>(f->file()) == NULL);
|
||||
}
|
||||
|
||||
void testAPE()
|
||||
{
|
||||
fileRefSave("mac-399.ape", ".ape");
|
||||
}
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestFileRef);
|
||||
|
Reference in New Issue
Block a user