Tag Parser  6.3.0
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 "../mediafileinfo.h"
5 #include "../tagvalue.h"
6 
7 #include <c++utilities/tests/testutils.h>
8 #include <c++utilities/conversion/stringconversion.h>
9 
10 #include <cppunit/extensions/HelperMacros.h>
11 #include <cppunit/TestFixture.h>
12 
13 #include <string>
14 #include <queue>
15 
16 using namespace std;
17 using namespace ConversionUtilities;
18 using namespace IoUtilities;
19 using namespace TestUtilities;
20 using namespace TestUtilities::Literals;
21 using namespace Media;
22 
23 using namespace CPPUNIT_NS;
24 
25 enum class TagStatus
26 {
27  Original,
29  Removed
30 };
31 
32 namespace SimpleTestFlags {
34 {
35  RemoveTag = 0x1,
36 };
37 }
38 
43 class OverallTests : public TestFixture
44 {
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 #ifdef PLATFORM_UNIX
52  CPPUNIT_TEST(testMp4Making);
53  CPPUNIT_TEST(testMp3Making);
54  CPPUNIT_TEST(testOggMaking);
55  CPPUNIT_TEST(testFlacMaking);
56  CPPUNIT_TEST(testMkvMakingWithDifferentSettings);
57  CPPUNIT_TEST(testMkvMakingNestedTags);
58 #endif
59  CPPUNIT_TEST_SUITE_END();
60 
61 public:
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 checkMp4TestMetaData();
89  void checkMp4Constraints();
90 
91  void checkMp3Testfile1();
92  void checkMp3TestMetaData();
93  void checkMp3PaddingConstraints();
94 
95  void checkOggTestfile1();
96  void checkOggTestfile2();
97  void checkOggTestMetaData();
98 
99  void checkFlacTestfile1();
100  void checkFlacTestfile2();
101 
102  void setMkvTestMetaData();
103  void setMp4TestMetaData();
104  void setMp3TestMetaData();
105  void setOggTestMetaData();
106  void removeAllTags();
107  void noop();
108  void createMkvWithNestedTags();
109  void addMp4Track();
110  void removeSecondTrack();
111 
112 public:
113  void testMkvParsing();
114  void testMp4Parsing();
115  void testMp3Parsing();
116  void testOggParsing();
117  void testFlacParsing();
118 #ifdef PLATFORM_UNIX
119  void testMkvMakingWithDifferentSettings();
120  void testMkvMakingNestedTags();
121  void testMp4Making();
122  void testMp3Making();
123  void testOggMaking();
124  void testFlacMaking();
125 #endif
126 
127 private:
128  MediaFileInfo m_fileInfo;
129  MediaFileInfo m_additionalFileInfo;
130  TagValue m_testTitle;
131  TagValue m_testComment;
132  TagValue m_testAlbum;
133  TagValue m_testPartNumber;
134  TagValue m_testTotalParts;
135  TagValue m_testPosition;
136  string m_testCover;
137  queue<TagValue> m_preservedMetaData;
138  string m_nestedTagsMkvPath;
139  string m_rawFlacPath;
140  string m_flacInOggPath;
141  TagStatus m_tagStatus;
142  uint16 m_mode;
143  ElementPosition m_expectedTagPos;
144  ElementPosition m_expectedIndexPos;
145 };
146 
147 #endif // TAGPARSER_OVERALL_TESTS_H
The TagValue class wraps values of different types.
Definition: tagvalue.h:63
STL namespace.
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:43
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:52
TagStatus
Definition: overall.h:25
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9