Tag Parser: tests/overall.h Source File

Tag Parser 12.5.2 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
overall.h
Go to the documentation of this file.
1#ifndef TAGPARSER_OVERALL_TESTS_H
2#define TAGPARSER_OVERALL_TESTS_H
3
4#include "./helper.h"
5
6#include "../diagnostics.h"
7#include "../mediafileinfo.h"
8#include "../progressfeedback.h"
9#include "../tagvalue.h"
10
11#include <c++utilities/chrono/datetime.h>
12#include <c++utilities/chrono/format.h>
13#include <c++utilities/conversion/stringconversion.h>
14#include <c++utilities/tests/testutils.h>
15using namespace CppUtilities;
16
17#include <cppunit/TestFixture.h>
18#include <cppunit/extensions/HelperMacros.h>
19
20#include <queue>
21#include <string>
22
23using namespace std;
24using namespace CppUtilities::Literals;
25using namespace TagParser;
26using namespace CPPUNIT_NS;
27
28 enum class TagStatus { Original, TestMetaDataPresent, Removed };
29
30 namespace SimpleTestFlags {
31 enum TestFlag {
32 RemoveTag = 0x1,
33};
34}
35
40 class OverallTests : public TestFixture {
41 CPPUNIT_TEST_SUITE(OverallTests);
42 CPPUNIT_TEST(testMp4Parsing);
43 CPPUNIT_TEST(testMp3Parsing);
44 CPPUNIT_TEST(testOggParsing);
45 CPPUNIT_TEST(testFlacParsing);
46 CPPUNIT_TEST(testMkvParsing);
47 CPPUNIT_TEST(testMp4Making);
48 CPPUNIT_TEST(testMp4MakingWith64BitOffsets);
49 CPPUNIT_TEST(testMp3Making);
50 CPPUNIT_TEST(testOggMaking);
51 CPPUNIT_TEST(testFlacMaking);
52 CPPUNIT_TEST(testMkvMakingWithDifferentSettings);
53 CPPUNIT_TEST(testMkvMakingNestedTags);
54 CPPUNIT_TEST(testVorbisCommentFieldHandling);
55 CPPUNIT_TEST_SUITE_END();
56
57public:
58 OverallTests();
59
60 void setUp() override;
61 void tearDown() override;
62
63private:
64 void parseFile(const string &path, void (OverallTests::*checkRoutine)(void));
65 void makeFile(const string &path, void (OverallTests::*modifyRoutine)(void), void (OverallTests::*checkRoutine)(void));
66
67 void checkMkvTestfile1();
68 void checkMkvTestfile2();
69 void checkMkvTestfile3();
70 void checkMkvTestfile4();
71 void checkMkvTestfile5();
72 void checkMkvTestfile6();
73 void checkMkvTestfile7();
74 void checkMkvTestfile8();
75 void checkMkvTestfileHandbrakeChapters();
76 void checkMkvTestfileNestedTags();
77 void checkMkvTestMetaData();
78 void checkMkvConstraints();
79
80 void checkMp4Testfile1();
81 void checkMp4Testfile2();
82 void checkMp4Testfile3();
83 void checkMp4Testfile4();
84 void checkMp4Testfile5();
85 void checkMp4Testfile6();
86 void checkMp4Testfile7();
87 void checkMp4TestMetaData();
88 void checkMp4Constraints();
89
90 void checkMp3Testfile1();
91 void checkMp3Testfile2();
92 void checkMp3TestMetaData();
93 void checkMp3PaddingConstraints();
94
95 void checkOggTestfile1();
96 void checkOggTestfile2();
97 void checkOggTestfile3();
98 void checkOggTestMetaData();
99 void checkOggTestMetaDataCover();
100
101 void checkFlacTestfile1();
102 void checkFlacTestfile2();
103
104 void setMkvTestMetaData();
105 void setMp4TestMetaData();
106 void setMp3TestMetaData1();
107 void setMp3TestMetaData2();
108 void setOggTestMetaData();
109 void setOggTestMetaDataCover();
110 void removeAllTags();
111 void noop();
112 void alterMp4Tracks();
113 void removeSecondTrack();
114
115public:
116 void testMkvParsing();
117 void testMp4Parsing();
118 void testMp3Parsing();
119 void testOggParsing();
120 void testFlacParsing();
121 void testMkvMakingWithDifferentSettings();
122 void testMkvMakingNestedTags();
123 void testMp4Making();
124 void testMp4MakingWith64BitOffsets();
125 void testMp3Making();
126 void testOggMaking();
127 void testFlacMaking();
128 void testVorbisCommentFieldHandling();
129
130private:
131 MediaFileInfo m_fileInfo;
132 MediaFileInfo m_additionalFileInfo;
133 Diagnostics m_diag;
134 AbortableProgressFeedback m_progress;
135 TagValue m_testTitle;
136 TagValue m_testComment;
137 TagValue m_testCommentWithoutDescription;
138 TagValue m_testAlbum;
139 TagValue m_testPartNumber;
140 TagValue m_testTotalParts;
141 TagValue m_testPosition;
142 string m_testCover;
143 queue<TagValue> m_preservedMetaData;
144 TagStatus m_tagStatus;
145 std::uint16_t m_mode;
146 ElementPosition m_expectedTagPos;
147 ElementPosition m_expectedIndexPos;
148};
149
150#endif // TAGPARSER_OVERALL_TESTS_H
OverallTests::testMp3Parsing
void testMp3Parsing()
Tests the MP3 parser via MediaFileInfo.
Definition overallmp3.cpp:365
OverallTests::testOggParsing
void testOggParsing()
Tests the Ogg parser via MediaFileInfo.
Definition overallogg.cpp:211
OverallTests::testMp3Making
void testMp3Making()
Tests the MP3 maker via MediaFileInfo.
Definition overallmp3.cpp:378
OverallTests::setUp
void setUp() override
Creates some test meta data.
Definition overallgeneral.cpp:13
OverallTests::testMp4MakingWith64BitOffsets
void testMp4MakingWith64BitOffsets()
Tests the MP4 maker via MediaFileInfo with a big padding to require 64-bit chunk offsets.
Definition overallmp4.cpp:617
OverallTests::testFlacParsing
void testFlacParsing()
Tests the FLAC parser via MediaFileInfo.
Definition overallflac.cpp:101
OverallTests::testVorbisCommentFieldHandling
void testVorbisCommentFieldHandling()
Tests the Vorbis Comment specifc handling of certain fields done in VorbisComment::convertTotalFields...
Definition overallogg.cpp:261
OverallTests::testFlacMaking
void testFlacMaking()
Tests the FLAC maker via MediaFileInfo.
Definition overallflac.cpp:114
OverallTests::OverallTests
OverallTests()
Definition overallgeneral.cpp:5
OverallTests::testMp4Making
void testMp4Making()
Tests the MP4 maker via MediaFileInfo.
Definition overallmp4.cpp:547
OverallTests::tearDown
void tearDown() override
Definition overallgeneral.cpp:25
OverallTests::testMkvMakingNestedTags
void testMkvMakingNestedTags()
Tests making a Matroska file with nested tags via MediaFileInfo.
Definition overallmkv.cpp:788
OverallTests::testMp4Parsing
void testMp4Parsing()
Tests the MP4 parser via MediaFileInfo.
Definition overallmp4.cpp:530
OverallTests::testMkvParsing
void testMkvParsing()
Tests the Matroska parser via MediaFileInfo.
Definition overallmkv.cpp:681
OverallTests::testMkvMakingWithDifferentSettings
void testMkvMakingWithDifferentSettings()
Tests the Matroska maker via MediaFileInfo.
Definition overallmkv.cpp:705
OverallTests::testOggMaking
void testOggMaking()
Tests the Ogg maker via MediaFileInfo.
Definition overallogg.cpp:227
TagParser::AbortableProgressFeedback
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
Definition progressfeedback.h:186
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition diagnostics.h:156
TagParser::MediaFileInfo
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition mediafileinfo.h:83
TagParser::TagValue
The TagValue class wraps values of different types.
Definition tagvalue.h:147
diagnostics.h
helper.h
mediafileinfo.h
CppUtilities
Definition abstractcontainer.h:16
SimpleTestFlags
Definition overall.h:30
SimpleTestFlags::TestFlag
TestFlag
Definition overall.h:31
SimpleTestFlags::RemoveTag
@ RemoveTag
Definition overall.h:32
TagParser
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
TagParser::ElementPosition
ElementPosition
Definition settings.h:13
TagStatus
TagStatus
Definition overall.h:28
TagStatus::Original
@ Original
Definition overall.h:28
TagStatus::Removed
@ Removed
Definition overall.h:28
TagStatus::TestMetaDataPresent
@ TestMetaDataPresent
Definition overall.h:28
progressfeedback.h
tagvalue.h