C bindings, fileref, fix warnings

This commit is contained in:
Urs Fleisch
2025-08-10 06:10:46 +02:00
parent 4546c00417
commit 6fa3db1e51
23 changed files with 227 additions and 54 deletions

View File

@ -65,6 +65,11 @@ IF(WITH_SHORTEN)
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/shorten
)
ENDIF()
IF(WITH_MATROSKA)
SET(test_HDR_DIRS ${test_HDR_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/matroska
)
ENDIF()
INCLUDE_DIRECTORIES(${test_HDR_DIRS})
SET(test_runner_SRCS
@ -152,6 +157,11 @@ IF(WITH_SHORTEN)
test_shorten.cpp
)
ENDIF()
IF(WITH_MATROSKA)
SET(test_runner_SRCS ${test_runner_SRCS}
test_matroska.cpp
)
ENDIF()
IF(BUILD_BINDINGS)
SET(test_runner_SRCS ${test_runner_SRCS}
test_tag_c.cpp

View File

@ -472,6 +472,11 @@ public:
#endif
#ifdef TAGLIB_WITH_SHORTEN
CPPUNIT_ASSERT(extensions.contains("shn"));
#endif
#ifdef TAGLIB_WITH_MATROSKA
CPPUNIT_ASSERT(extensions.contains("mkv"));
CPPUNIT_ASSERT(extensions.contains("mka"));
CPPUNIT_ASSERT(extensions.contains("webm"));
#endif
}

28
tests/test_matroska.cpp Normal file
View File

@ -0,0 +1,28 @@
#include <string>
#include <cstdio>
#include "tbytevectorlist.h"
#include "tpropertymap.h"
#include "tag.h"
#include "matroskafile.h"
#include "plainfile.h"
#include <cppunit/extensions/HelperMacros.h>
#include "utils.h"
using namespace std;
using namespace TagLib;
class TestMatroska : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestMatroska);
CPPUNIT_TEST(testTags);
CPPUNIT_TEST_SUITE_END();
public:
void testTags()
{
// TODO implement
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestMatroska);

View File

@ -148,6 +148,11 @@
#include "trueaudiofile.h"
#include "trueaudioproperties.h"
#endif
#ifdef TAGLIB_WITH_MATROSKA
#include "matroskafile.h"
#include "matroskaproperties.h"
#include "matroskatag.h"
#endif
#include <cppunit/extensions/HelperMacros.h>
@ -297,6 +302,12 @@ public:
#ifdef TAGLIB_WITH_TRUEAUDIO
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::TrueAudio::File));
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::TrueAudio::Properties));
#endif
#ifdef TAGLIB_WITH_MATROSKA
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Matroska::File));
CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Matroska::Properties));
// TODO move non pimpl fields into private class.
// CPPUNIT_ASSERT_EQUAL(classSize(1, true), sizeof(TagLib::Matroska::Tag));
#endif
}