Test for ID3v1 false positives.

This commit is contained in:
James D. Smith 2022-03-10 10:52:22 -07:00 committed by Urs Fleisch
parent cebaf9a8e2
commit 10721b4b41

View File

@ -29,6 +29,7 @@
#include <tstringlist.h>
#include <tbytevectorlist.h>
#include <tpropertymap.h>
#include <apefile.h>
#include <apetag.h>
#include <tdebug.h>
#include <cppunit/extensions/HelperMacros.h>
@ -46,6 +47,7 @@ class TestAPETag : public CppUnit::TestFixture
CPPUNIT_TEST(testPropertyInterface2);
CPPUNIT_TEST(testInvalidKeys);
CPPUNIT_TEST(testTextBinary);
CPPUNIT_TEST(testID3v1Collision);
CPPUNIT_TEST_SUITE_END();
public:
@ -165,6 +167,24 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector(), item.binaryData());
}
void testID3v1Collision()
{
ScopedFileCopy copy("no-tags", ".mpc");
string newname = copy.fileName();
{
APE::File f(newname.c_str());
f.APETag(true)->setArtist("Filltointersect ");
f.APETag()->setTitle("Filltointersect ");
f.save();
}
{
APE::File f(newname.c_str());
CPPUNIT_ASSERT(!f.hasID3v1Tag());
}
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestAPETag);