20 m_testPartNumber.assignInteger(41);
21 m_testTotalParts.assignInteger(61);
32void OverallTests::parseFile(
const string &path,
void (
OverallTests::*checkRoutine)(
void))
35 cerr <<
"- testing " << path << endl;
42 (this->*checkRoutine)();
50void OverallTests::makeFile(
const string &path,
void (
OverallTests::*modifyRoutine)(
void),
void (
OverallTests::*checkRoutine)(
void))
53 cerr <<
"- testing " << path << endl;
56 m_fileInfo.setPath(path);
57 m_fileInfo.reopen(
true);
58 m_fileInfo.parseEverything(m_diag, m_progress);
61 switch (m_fileInfo.containerFormat()) {
62 case ContainerFormat::Mp4:
63 CPPUNIT_ASSERT(m_fileInfo.container());
64 if (m_fileInfo.tagPosition() != ElementPosition::Keep) {
65 m_expectedTagPos = m_fileInfo.tagPosition();
67 m_expectedTagPos = m_fileInfo.container()->determineTagPosition(m_diag);
68 if (m_expectedTagPos == ElementPosition::Keep) {
71 m_expectedTagPos = m_fileInfo.container()->determineIndexPosition(m_diag);
75 case ContainerFormat::Matroska:
76 CPPUNIT_ASSERT(m_fileInfo.container());
78 if (m_fileInfo.tagPosition() != ElementPosition::Keep) {
79 m_expectedTagPos = m_fileInfo.tagPosition();
81 m_expectedTagPos = m_fileInfo.container()->determineTagPosition(m_diag);
85 m_expectedIndexPos = m_fileInfo.container()->determineIndexPosition(m_diag);
86 if (m_fileInfo.indexPosition() != ElementPosition::Keep && m_expectedIndexPos != ElementPosition::Keep) {
87 m_expectedIndexPos = m_fileInfo.indexPosition();
94 (this->*modifyRoutine)();
96 m_fileInfo.applyChanges(m_diag, m_progress);
97 m_fileInfo.clearParsingResults();
99 m_fileInfo.parseEverything(m_diag, m_progress);
100 (this->*checkRoutine)();
102 switch (m_fileInfo.containerFormat()) {
103 case ContainerFormat::Matroska:
104 checkMkvConstraints();
106 case ContainerFormat::Mp4:
107 checkMp4Constraints();
109 case ContainerFormat::MpegAudioFrames:
110 case ContainerFormat::Adts:
111 checkMp3PaddingConstraints();
118 remove(path.c_str());
119 remove((path +
".bak").c_str());
125void OverallTests::removeAllTags()
127 m_fileInfo.removeAllTags();
134void OverallTests::noop()
141void OverallTests::removeSecondTrack()
143 CPPUNIT_ASSERT(m_fileInfo.container());
144 CPPUNIT_ASSERT(m_fileInfo.container()->trackCount() >= 2);
145 m_fileInfo.container()->removeTrack(m_fileInfo.container()->track(1));
The OverallTests class tests reading and writing tags and parsing technical information for all suppo...
void setUp() override
Creates some test meta data.
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
void reopen(bool readOnly=false)
Opens a std::fstream for the current file.
void close()
A possibly opened std::fstream will be closed.
void setPath(std::string_view path)
Sets the current file.
CPPUNIT_TEST_SUITE_REGISTRATION(OverallTests)