Adapt most changes from taglib2

This commit is contained in:
Jonas Kvinge
2020-06-26 23:30:30 +02:00
parent 08882639e0
commit 5f71a558b9
374 changed files with 13708 additions and 4418 deletions

View File

@@ -0,0 +1,91 @@
enable_testing()
find_package(CppUnit REQUIRED)
SET(TAGLIB_TESTS_SOURCES
main.cpp
test_list.cpp
test_map.cpp
test_mpeg.cpp
test_synchdata.cpp
test_trueaudio.cpp
test_bytevector.cpp
test_bytevectorlist.cpp
test_bytevectorstream.cpp
test_string.cpp
test_propertymap.cpp
test_file.cpp
test_fileref.cpp
test_id3v1.cpp
test_id3v2.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
)
link_directories(${TAGLIB_LIBRARY_DIRS})
add_executable(taglib_tests ${TAGLIB_TESTS_SOURCES})
target_include_directories(taglib_tests PRIVATE
${CPPUNIT_INCLUDE_DIR}
${TAGLIB_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}/../../3rdparty/taglib
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/toolkit
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/ape
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/asf
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mpeg/id3v1
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mpeg/id3v2
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mpeg/id3v2/frames
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mpeg
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mpc
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mp4
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/riff
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/riff/aiff
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/riff/wav
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/trueaudio
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/ogg
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/ogg/vorbis
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/ogg/flac
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/ogg/speex
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/ogg/opus
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/flac
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/wavpack
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/mod
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/s3m
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/it
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/xm
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/dsf
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/taglib/dsdiff
)
target_link_libraries(taglib_tests PRIVATE
${CPPUNIT_LIBRARIES}
${TAGLIB_LIBRARIES}
)
add_test(taglib_tests taglib_tests)
add_custom_target(run_taglib_tests COMMAND ${CMAKE_CTEST_COMMAND} -V DEPENDS taglib_tests)

Binary file not shown.

BIN
tests/taglib/data/64bit.mp4 Normal file

Binary file not shown.

BIN
tests/taglib/data/alaw.aifc Normal file

Binary file not shown.

BIN
tests/taglib/data/alaw.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/ape.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/click.mpc Normal file

Binary file not shown.

BIN
tests/taglib/data/click.wv Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/empty.dsf Normal file

Binary file not shown.

BIN
tests/taglib/data/empty.ogg Normal file

Binary file not shown.

BIN
tests/taglib/data/empty.spx Normal file

Binary file not shown.

BIN
tests/taglib/data/empty.tta Normal file

Binary file not shown.

BIN
tests/taglib/data/empty.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/gnre.m4a Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/mpeg2.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/noise.aif Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
MPCKSH

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/tagged.wv Normal file

Binary file not shown.

BIN
tests/taglib/data/test.it Normal file

Binary file not shown.

BIN
tests/taglib/data/test.ogg Normal file

Binary file not shown.

BIN
tests/taglib/data/test.s3m Normal file

Binary file not shown.

BIN
tests/taglib/data/test.xm Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/taglib/data/w000.mp3 Normal file

Binary file not shown.

BIN
tests/taglib/data/xing.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

88
tests/taglib/main.cpp Normal file
View File

@@ -0,0 +1,88 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <stdexcept>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/XmlOutputter.h>
int main(int argc, char *argv[]) {
std::string testPath = (argc > 1) ? std::string(argv[1]) : "";
// Create the event manager and test controller
CppUnit::TestResult controller;
// Add a listener that collects test result
CppUnit::TestResultCollector result;
controller.addListener(&result);
// Add a listener that print dots as test run.
CppUnit::BriefTestProgressListener progress;
controller.addListener(&progress);
// Add the top suite to the test runner
CppUnit::TestRunner runner;
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
try {
std::cout << "Running " << testPath;
runner.run(controller, testPath);
std::cerr << std::endl;
// Print test in a compiler compatible format.
CppUnit::CompilerOutputter outputter(&result, std::cerr);
outputter.write();
#if defined(_MSC_VER) && _MSC_VER > 1500
char *xml = NULL;
::_dupenv_s(&xml, NULL, "CPPUNIT_XML");
#else
char *xml = ::getenv("CPPUNIT_XML");
#endif
if (xml && !::strcmp(xml, "1")) {
std::ofstream xmlfileout("cpptestresults.xml");
CppUnit::XmlOutputter xmlout(&result, xmlfileout);
xmlout.write();
}
#if defined(_MSC_VER) && _MSC_VER > 1500
::free(xml);
#endif
} catch (std::invalid_argument &e) {
std::cerr << std::endl
<< "ERROR: " << e.what()
<< std::endl;
return 0;
}
return result.wasSuccessful() ? 0 : 1;
}

Some files were not shown because too many files have changed in this diff Show More