Tag Parser  6.5.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 "../mediafileinfo.h"
5 #include "../tagvalue.h"
6 
7 #include <c++utilities/conversion/stringconversion.h>
8 #include <c++utilities/tests/testutils.h>
9 using namespace TestUtilities;
10 
11 #include <cppunit/extensions/HelperMacros.h>
12 #include <cppunit/TestFixture.h>
13 
14 #include <string>
15 #include <queue>
16 
17 using namespace std;
18 using namespace ConversionUtilities;
19 using namespace IoUtilities;
20 using namespace TestUtilities;
21 using namespace TestUtilities::Literals;
22 using namespace Media;
23 
24 using namespace CPPUNIT_NS;
25 
26 enum class TagStatus
27 {
28  Original,
30  Removed
31 };
32 
33 namespace SimpleTestFlags {
35 {
36  RemoveTag = 0x1,
37 };
38 }
39 
44 class OverallTests : public TestFixture
45 {
46  CPPUNIT_TEST_SUITE(OverallTests);
47  CPPUNIT_TEST(testMp4Parsing);
48  CPPUNIT_TEST(testMp3Parsing);
49  CPPUNIT_TEST(testOggParsing);
50  CPPUNIT_TEST(testFlacParsing);
51  CPPUNIT_TEST(testMkvParsing);
52 #ifdef PLATFORM_UNIX
53  CPPUNIT_TEST(testMp4Making);
54  CPPUNIT_TEST(testMp3Making);
55  CPPUNIT_TEST(testOggMaking);
56  CPPUNIT_TEST(testFlacMaking);
57  CPPUNIT_TEST(testMkvMakingWithDifferentSettings);
58  CPPUNIT_TEST(testMkvMakingNestedTags);
59 #endif
60  CPPUNIT_TEST_SUITE_END();
61 
62 public:
63  void setUp();
64  void tearDown();
65 
66 private:
67  void parseFile(const string &path, void (OverallTests::* checkRoutine)(void));
68  void makeFile(const string &path, void (OverallTests::* modifyRoutine)(void), void (OverallTests::* checkRoutine)(void));
69 
70  void checkMkvTestfile1();
71  void checkMkvTestfile2();
72  void checkMkvTestfile3();
73  void checkMkvTestfile4();
74  void checkMkvTestfile5();
75  void checkMkvTestfile6();
76  void checkMkvTestfile7();
77  void checkMkvTestfile8();
78  void checkMkvTestfileHandbrakeChapters();
79  void checkMkvTestfileNestedTags();
80  void checkMkvTestMetaData();
81  void checkMkvConstraints();
82 
83  void checkMp4Testfile1();
84  void checkMp4Testfile2();
85  void checkMp4Testfile3();
86  void checkMp4Testfile4();
87  void checkMp4Testfile5();
88  void checkMp4Testfile6();
89  void checkMp4TestMetaData();
90  void checkMp4Constraints();
91 
92  void checkMp3Testfile1();
93  void checkMp3TestMetaData();
94  void checkMp3PaddingConstraints();
95 
96  void checkOggTestfile1();
97  void checkOggTestfile2();
98  void checkOggTestMetaData();
99 
100  void checkFlacTestfile1();
101  void checkFlacTestfile2();
102 
103  void setMkvTestMetaData();
104  void setMp4TestMetaData();
105  void setMp3TestMetaData();
106  void setOggTestMetaData();
107  void removeAllTags();
108  void noop();
109  void createMkvWithNestedTags();
110  void alterMp4Tracks();
111  void removeSecondTrack();
112 
113 public:
114  void testMkvParsing();
115  void testMp4Parsing();
116  void testMp3Parsing();
117  void testOggParsing();
118  void testFlacParsing();
119 #ifdef PLATFORM_UNIX
120  void testMkvMakingWithDifferentSettings();
121  void testMkvMakingNestedTags();
122  void testMp4Making();
123  void testMp3Making();
124  void testOggMaking();
125  void testFlacMaking();
126 #endif
127 
128 private:
129  MediaFileInfo m_fileInfo;
130  MediaFileInfo m_additionalFileInfo;
131  TagValue m_testTitle;
132  TagValue m_testComment;
133  TagValue m_testAlbum;
134  TagValue m_testPartNumber;
135  TagValue m_testTotalParts;
136  TagValue m_testPosition;
137  string m_testCover;
138  queue<TagValue> m_preservedMetaData;
139  string m_nestedTagsMkvPath;
140  string m_rawFlacPath;
141  string m_flacInOggPath;
142  TagStatus m_tagStatus;
143  uint16 m_mode;
144  ElementPosition m_expectedTagPos;
145  ElementPosition m_expectedIndexPos;
146 };
147 
148 #endif // TAGPARSER_OVERALL_TESTS_H
The TagValue class wraps values of different types.
Definition: tagvalue.h:64
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:44
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:53
TagStatus
Definition: overall.h:26
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9