Tag Parser  7.0.3
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/conversion/stringconversion.h>
12 #include <c++utilities/tests/testutils.h>
13 using namespace TestUtilities;
14 
15 #include <cppunit/TestFixture.h>
16 #include <cppunit/extensions/HelperMacros.h>
17 
18 #include <queue>
19 #include <string>
20 
21 using namespace std;
22 using namespace ConversionUtilities;
23 using namespace IoUtilities;
24 using namespace TestUtilities;
25 using namespace TestUtilities::Literals;
26 using namespace TagParser;
27 
28 using namespace CPPUNIT_NS;
29 
31 
32 namespace SimpleTestFlags {
33 enum TestFlag {
34  RemoveTag = 0x1,
35 };
36 }
37 
42 class OverallTests : public TestFixture {
43  CPPUNIT_TEST_SUITE(OverallTests);
44  CPPUNIT_TEST(testMp4Parsing);
45  CPPUNIT_TEST(testMp3Parsing);
46  CPPUNIT_TEST(testOggParsing);
47  CPPUNIT_TEST(testFlacParsing);
48  CPPUNIT_TEST(testMkvParsing);
49 #ifdef PLATFORM_UNIX
50  CPPUNIT_TEST(testMp4Making);
51  CPPUNIT_TEST(testMp3Making);
52  CPPUNIT_TEST(testOggMaking);
53  CPPUNIT_TEST(testFlacMaking);
54  CPPUNIT_TEST(testMkvMakingWithDifferentSettings);
55  CPPUNIT_TEST(testMkvMakingNestedTags);
56 #endif
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 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 alterMp4Tracks();
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  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  string m_nestedTagsMkvPath;
141  string m_rawFlacPath;
142  string m_flacInOggPath;
143  TagStatus m_tagStatus;
144  uint16 m_mode;
145  ElementPosition m_expectedTagPos;
146  ElementPosition m_expectedIndexPos;
147 };
148 
149 #endif // TAGPARSER_OVERALL_TESTS_H
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
TagStatus
Definition: overall.h:30
ElementPosition
Definition: settings.h:10