Tag Parser  10.0.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
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>
15 using namespace CppUtilities;
16 
17 #include <cppunit/TestFixture.h>
18 #include <cppunit/extensions/HelperMacros.h>
19 
20 #include <queue>
21 #include <string>
22 
23 using namespace std;
24 using namespace CppUtilities::Literals;
25 using namespace TagParser;
26 using namespace CPPUNIT_NS;
27 
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(testMp3Making);
49  CPPUNIT_TEST(testOggMaking);
50  CPPUNIT_TEST(testFlacMaking);
51  CPPUNIT_TEST(testMkvMakingWithDifferentSettings);
52  CPPUNIT_TEST(testMkvMakingNestedTags);
53  CPPUNIT_TEST_SUITE_END();
54 
55 public:
56  OverallTests();
57 
58  void setUp() override;
59  void tearDown() override;
60 
61 private:
62  void parseFile(const string &path, void (OverallTests::*checkRoutine)(void));
63  void makeFile(const string &path, void (OverallTests::*modifyRoutine)(void), void (OverallTests::*checkRoutine)(void));
64 
65  void checkMkvTestfile1();
66  void checkMkvTestfile2();
67  void checkMkvTestfile3();
68  void checkMkvTestfile4();
69  void checkMkvTestfile5();
70  void checkMkvTestfile6();
71  void checkMkvTestfile7();
72  void checkMkvTestfile8();
73  void checkMkvTestfileHandbrakeChapters();
74  void checkMkvTestfileNestedTags();
75  void checkMkvTestMetaData();
76  void checkMkvConstraints();
77 
78  void checkMp4Testfile1();
79  void checkMp4Testfile2();
80  void checkMp4Testfile3();
81  void checkMp4Testfile4();
82  void checkMp4Testfile5();
83  void checkMp4Testfile6();
84  void checkMp4Testfile7();
85  void checkMp4TestMetaData();
86  void checkMp4Constraints();
87 
88  void checkMp3Testfile1();
89  void checkMp3Testfile2();
90  void checkMp3TestMetaData();
91  void checkMp3PaddingConstraints();
92 
93  void checkOggTestfile1();
94  void checkOggTestfile2();
95  void checkOggTestMetaData();
96 
97  void checkFlacTestfile1();
98  void checkFlacTestfile2();
99 
100  void setMkvTestMetaData();
101  void setMp4TestMetaData();
102  void setMp3TestMetaData1();
103  void setMp3TestMetaData2();
104  void setOggTestMetaData();
105  void removeAllTags();
106  void noop();
107  void alterMp4Tracks();
108  void removeSecondTrack();
109 
110 public:
111  void testMkvParsing();
112  void testMp4Parsing();
113  void testMp3Parsing();
114  void testOggParsing();
115  void testFlacParsing();
116  void testMkvMakingWithDifferentSettings();
117  void testMkvMakingNestedTags();
118  void testMp4Making();
119  void testMp3Making();
120  void testOggMaking();
121  void testFlacMaking();
122 
123 private:
124  MediaFileInfo m_fileInfo;
125  MediaFileInfo m_additionalFileInfo;
126  Diagnostics m_diag;
127  AbortableProgressFeedback m_progress;
128  TagValue m_testTitle;
129  TagValue m_testComment;
130  TagValue m_testCommentWithoutDescription;
131  TagValue m_testAlbum;
132  TagValue m_testPartNumber;
133  TagValue m_testTotalParts;
134  TagValue m_testPosition;
135  string m_testCover;
136  queue<TagValue> m_preservedMetaData;
137  TagStatus m_tagStatus;
138  std::uint16_t m_mode;
139  ElementPosition m_expectedTagPos;
140  ElementPosition m_expectedIndexPos;
141 };
142 
143 #endif // TAGPARSER_OVERALL_TESTS_H
The OverallTests class tests reading and writing tags and parsing technical information for all suppo...
Definition: overall.h:40
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:74
The TagValue class wraps values of different types.
Definition: tagvalue.h:95
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
ElementPosition
Definition: settings.h:13
TagStatus
Definition: overall.h:28
@ TestMetaDataPresent