Tag Parser  8.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 TestUtilities;
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 ConversionUtilities;
25 using namespace IoUtilities;
26 using namespace TestUtilities;
27 using namespace TestUtilities::Literals;
28 using namespace TagParser;
29 
30 using namespace CPPUNIT_NS;
31 
33 
34 namespace SimpleTestFlags {
35 enum TestFlag {
36  RemoveTag = 0x1,
37 };
38 }
39 
44 class OverallTests : public TestFixture {
45  CPPUNIT_TEST_SUITE(OverallTests);
46  CPPUNIT_TEST(testMp4Parsing);
47  CPPUNIT_TEST(testMp3Parsing);
48  CPPUNIT_TEST(testOggParsing);
49  CPPUNIT_TEST(testFlacParsing);
50  CPPUNIT_TEST(testMkvParsing);
51  CPPUNIT_TEST(testMp4Making);
52  CPPUNIT_TEST(testMp3Making);
53  CPPUNIT_TEST(testOggMaking);
54  CPPUNIT_TEST(testFlacMaking);
55  CPPUNIT_TEST(testMkvMakingWithDifferentSettings);
56  CPPUNIT_TEST(testMkvMakingNestedTags);
57  CPPUNIT_TEST_SUITE_END();
58 
59 public:
60  OverallTests();
61 
62  void setUp();
63  void tearDown();
64 
65 private:
66  void parseFile(const string &path, void (OverallTests::*checkRoutine)(void));
67  void makeFile(const string &path, void (OverallTests::*modifyRoutine)(void), void (OverallTests::*checkRoutine)(void));
68 
69  void checkMkvTestfile1();
70  void checkMkvTestfile2();
71  void checkMkvTestfile3();
72  void checkMkvTestfile4();
73  void checkMkvTestfile5();
74  void checkMkvTestfile6();
75  void checkMkvTestfile7();
76  void checkMkvTestfile8();
77  void checkMkvTestfileHandbrakeChapters();
78  void checkMkvTestfileNestedTags();
79  void checkMkvTestMetaData();
80  void checkMkvConstraints();
81 
82  void checkMp4Testfile1();
83  void checkMp4Testfile2();
84  void checkMp4Testfile3();
85  void checkMp4Testfile4();
86  void checkMp4Testfile5();
87  void checkMp4Testfile6();
88  void checkMp4Testfile7();
89  void checkMp4TestMetaData();
90  void checkMp4Constraints();
91 
92  void checkMp3Testfile1();
93  void checkMp3Testfile2();
94  void checkMp3TestMetaData();
95  void checkMp3PaddingConstraints();
96 
97  void checkOggTestfile1();
98  void checkOggTestfile2();
99  void checkOggTestMetaData();
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 removeAllTags();
110  void noop();
111  void alterMp4Tracks();
112  void removeSecondTrack();
113 
114 public:
115  void testMkvParsing();
116  void testMp4Parsing();
117  void testMp3Parsing();
118  void testOggParsing();
119  void testFlacParsing();
120  void testMkvMakingWithDifferentSettings();
121  void testMkvMakingNestedTags();
122  void testMp4Making();
123  void testMp3Making();
124  void testOggMaking();
125  void testFlacMaking();
126 
127 private:
128  MediaFileInfo m_fileInfo;
129  MediaFileInfo m_additionalFileInfo;
130  Diagnostics m_diag;
131  AbortableProgressFeedback m_progress;
132  TagValue m_testTitle;
133  TagValue m_testComment;
134  TagValue m_testAlbum;
135  TagValue m_testPartNumber;
136  TagValue m_testTotalParts;
137  TagValue m_testPosition;
138  string m_testCover;
139  queue<TagValue> m_preservedMetaData;
140  TagStatus m_tagStatus;
141  uint16 m_mode;
142  ElementPosition m_expectedTagPos;
143  ElementPosition m_expectedIndexPos;
144 };
145 
146 #endif // TAGPARSER_OVERALL_TESTS_H
STL namespace.
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:44
Contains utility classes helping to read and write streams.
The OverallTests class tests reading and writing tags and parsing technical information for all suppo...
Definition: overall.h:44
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks...
TagStatus
Definition: overall.h:32
The TagValue class wraps values of different types.
Definition: tagvalue.h:65
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9
ElementPosition
Definition: settings.h:10
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156