diff options
author | Scott Wheeler <scott@directededge.com> | 2019-09-10 15:27:44 +0200 |
---|---|---|
committer | Scott Wheeler <scott@directededge.com> | 2019-09-10 22:59:07 +0200 |
commit | b8dc105ae3ae5948ac6c7e3a45d5e4d6d846bd75 (patch) | |
tree | 0f8220191989f0d46d0271cc8df5fe3f502d7181 /tests | |
parent | fced0f46e950c88c4646c081090705e3de6f4d5e (diff) |
Deprecate calls to MPEG::File::save(...) that use boolean params
This uses explicit enums for e.g. the ID3v2 version, making calls more
readable:
file.save(ID3v1 | ID3v2, StripOthers, ID3v2::v4, Duplicate);
Instead of:
file.save(ID3v1 | ID3v2, true, 4, true);
Needs to be ported to other types, per #922
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_id3v2.cpp | 10 | ||||
-rw-r--r-- | tests/test_mpeg.cpp | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp index 0e36d77f..d42907a5 100644 --- a/tests/test_id3v2.cpp +++ b/tests/test_id3v2.cpp @@ -145,7 +145,7 @@ public: MPEG::File file(newname.c_str()); file.ID3v2Tag(true)->addFrame(f); - file.save(MPEG::File::ID3v2, true, 3); + file.save(MPEG::File::ID3v2, File::StripOthers, ID3v2::v3); CPPUNIT_ASSERT_EQUAL(true, file.hasID3v2Tag()); ByteVector data = f->render(); @@ -166,7 +166,7 @@ public: MPEG::File file(copy.fileName().c_str()); file.ID3v2Tag(true)->addFrame(f); - file.save(MPEG::File::ID3v2, true, 3); + file.save(MPEG::File::ID3v2, File::StripOthers, ID3v2::v3); CPPUNIT_ASSERT(file.hasID3v2Tag()); ByteVector data = f->render(); @@ -756,7 +756,7 @@ public: foo.ID3v2Tag()->addFrame(new ID3v2::TextIdentificationFrame("TSOT", String::Latin1)); foo.ID3v2Tag()->addFrame(new ID3v2::TextIdentificationFrame("TSST", String::Latin1)); foo.ID3v2Tag()->addFrame(new ID3v2::TextIdentificationFrame("TSOP", String::Latin1)); - foo.save(MPEG::File::AllTags, true, 3); + foo.save(MPEG::File::AllTags, File::StripOthers, ID3v2::v3); } { MPEG::File bar(newname.c_str()); @@ -1029,7 +1029,7 @@ public: MPEG::File bar(newname.c_str()); bar.ID3v2Tag()->removeFrames("TPE1"); // Should strip ID3v1 here and not add old values to ID3v2 again - bar.save(MPEG::File::ID3v2, true); + bar.save(MPEG::File::ID3v2, File::StripOthers); } MPEG::File f(newname.c_str()); @@ -1275,7 +1275,7 @@ public: CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate()); f.ID3v2Tag()->setArtist("Artist A"); - f.save(MPEG::File::ID3v2, true); + f.save(MPEG::File::ID3v2, File::StripOthers); } { MPEG::File f(copy.fileName().c_str()); diff --git a/tests/test_mpeg.cpp b/tests/test_mpeg.cpp index fd46f9ed..45d60ece 100644 --- a/tests/test_mpeg.cpp +++ b/tests/test_mpeg.cpp @@ -187,7 +187,7 @@ public: f.tag()->setTitle(xxx); f.tag()->setArtist("Artist A"); - f.save(MPEG::File::AllTags, true, 4); + f.save(MPEG::File::AllTags, File::StripOthers, ID3v2::v4); CPPUNIT_ASSERT_EQUAL(true, f.hasID3v2Tag()); } { @@ -230,7 +230,7 @@ public: f.tag()->setTitle(xxx); f.tag()->setArtist("Artist A"); - f.save(MPEG::File::AllTags, true, 3); + f.save(MPEG::File::AllTags, File::StripOthers, ID3v2::v3); CPPUNIT_ASSERT_EQUAL(true, f.hasID3v2Tag()); } { @@ -369,7 +369,7 @@ public: { MPEG::File f(copy.fileName().c_str()); f.ID3v2Tag(true)->setTitle(""); - f.save(MPEG::File::ID3v2, false); + f.save(MPEG::File::ID3v2, File::StripNone); } { MPEG::File f(copy.fileName().c_str()); @@ -389,7 +389,7 @@ public: { MPEG::File f(copy.fileName().c_str()); f.ID3v1Tag(true)->setTitle(""); - f.save(MPEG::File::ID3v1, false); + f.save(MPEG::File::ID3v1, File::StripNone); } { MPEG::File f(copy.fileName().c_str()); @@ -409,7 +409,7 @@ public: { MPEG::File f(copy.fileName().c_str()); f.APETag(true)->setTitle(""); - f.save(MPEG::File::APE, false); + f.save(MPEG::File::APE, File::StripNone); } { MPEG::File f(copy.fileName().c_str()); |