mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Fix XiphComment::setComment() for the case that a Vorbis comment has the "COMMENT" field.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <flacfile.h>
|
||||
#include <xiphcomment.h>
|
||||
#include <tpropertymap.h>
|
||||
#include <tdebug.h>
|
||||
@ -17,6 +18,7 @@ class TestXiphComment : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testTrack);
|
||||
CPPUNIT_TEST(testSetTrack);
|
||||
CPPUNIT_TEST(testInvalidKeys);
|
||||
CPPUNIT_TEST(testClearComment);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -74,6 +76,22 @@ public:
|
||||
CPPUNIT_ASSERT(cmt.properties().isEmpty());
|
||||
}
|
||||
|
||||
void testClearComment()
|
||||
{
|
||||
ScopedFileCopy copy("no-tags", ".flac");
|
||||
|
||||
{
|
||||
FLAC::File f(copy.fileName().c_str());
|
||||
f.xiphComment()->addField("COMMENT", "Comment1");
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
FLAC::File f(copy.fileName().c_str());
|
||||
f.xiphComment()->setComment("");
|
||||
CPPUNIT_ASSERT_EQUAL(String(""), f.xiphComment()->comment());
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestXiphComment);
|
||||
|
Reference in New Issue
Block a user