Tag Parser  6.2.2
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 Media;
21 
22 using namespace CPPUNIT_NS;
23 
24 enum class TagStatus
25 {
26  Original,
28  Removed
29 };
30 
31 namespace SimpleTestFlags {
33 {
34  RemoveTag = 0x1,
35 };
36 }
37 
42 class OverallTests : public TestFixture
43 {
44  CPPUNIT_TEST_SUITE(OverallTests);
45  CPPUNIT_TEST(testMp4Parsing);
46  CPPUNIT_TEST(testMp3Parsing);
47  CPPUNIT_TEST(testOggParsing);
48  CPPUNIT_TEST(testFlacParsing);
49  CPPUNIT_TEST(testMkvParsing);
50 #ifdef PLATFORM_UNIX
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 #endif
58  CPPUNIT_TEST_SUITE_END();
59 
60 public:
61  void setUp();
62  void tearDown();
63 
64 private:
65  void parseFile(const string &path, void (OverallTests::* checkRoutine)(void));
66  void makeFile(const string &path, void (OverallTests::* modifyRoutine)(void), void (OverallTests::* checkRoutine)(void));
67 
68  void checkMkvTestfile1();
69  void checkMkvTestfile2();
70  void checkMkvTestfile3();
71  void checkMkvTestfile4();
72  void checkMkvTestfile5();
73  void checkMkvTestfile6();
74  void checkMkvTestfile7();
75  void checkMkvTestfile8();
76  void checkMkvTestfileHandbrakeChapters();
77  void checkMkvTestfileNestedTags();
78  void checkMkvTestMetaData();
79  void checkMkvConstraints();
80 
81  void checkMp4Testfile1();
82  void checkMp4Testfile2();
83  void checkMp4Testfile3();
84  void checkMp4Testfile4();
85  void checkMp4Testfile5();
86  void checkMp4TestMetaData();
87  void checkMp4Constraints();
88 
89  void checkMp3Testfile1();
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 setMp3TestMetaData();
103  void setOggTestMetaData();
104  void removeAllTags();
105  void noop();
106  void createMkvWithNestedTags();
107  void createFlacFiles();
108 
109 public:
110  void testMkvParsing();
111  void testMp4Parsing();
112  void testMp3Parsing();
113  void testOggParsing();
114  void testFlacParsing();
115 #ifdef PLATFORM_UNIX
116  void testMkvMakingWithDifferentSettings();
117  void testMkvMakingNestedTags();
118  void testMp4Making();
119  void testMp3Making();
120  void testOggMaking();
121  void testFlacMaking();
122 #endif
123 
124 private:
125  MediaFileInfo m_fileInfo;
126  TagValue m_testTitle;
127  TagValue m_testComment;
128  TagValue m_testAlbum;
129  TagValue m_testPartNumber;
130  TagValue m_testTotalParts;
131  TagValue m_testPosition;
132  string m_testCover;
133  queue<TagValue> m_preservedMetaData;
134  string m_nestedTagsMkvPath;
135  string m_rawFlacPath;
136  string m_flacInOggPath;
137  TagStatus m_tagStatus;
138  uint16 m_mode;
139  ElementPosition m_expectedTagPos;
140  ElementPosition m_expectedIndexPos;
141 };
142 
143 #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:42
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:52
TagStatus
Definition: overall.h:24
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9