55#include " generated_files\testRandom1\_testRandom1.h"
66#include " generated_files\testRandom2\_testRandom2.h"
77#include " generated_files\testRandom3\_testRandom3.h"
8+ #include " generated_files\testRandom4\_testRandom4.h"
9+ #include " generated_files\testRandom5\_testRandom5.h"
10+ #include " generated_files\testRandom6\_testRandom6.h"
11+ #include " generated_files\testRandom7\_testRandom7.h"
12+ #include " generated_files\testRandom8\_testRandom8.h"
813#include " generated_files\testSequential10MB\_testSequential10MB.h"
914#include " generated_files\testText10\_testText10.h"
1015#include " generated_files\testText1000\_testText1000.h"
1116#include " generated_files\testText100000\_testText100000.h"
17+ #include " generated_files\testIssue12\_testIssue12.h"
18+ #include " generated_files\testIssue12Mini\_testIssue12Mini.h"
1219#include " generated_files\testIssue13\_testIssue13.h"
1320
1421gTestHelper & hlp = gTestHelper ::getInstance();
@@ -148,6 +155,81 @@ TEST_F(TestExtraction, testRandom3)
148155 ASSERT_TRUE (equal) << reason.c_str ();
149156}
150157
158+ TEST_F (TestExtraction, testRandom4)
159+ {
160+ static const std::string expectedFilePath = getExpectedFilePath ();
161+ static const std::string outputFilePath = getActualFilePath ();
162+
163+ const bin2cpp::File & file = bin2cpp::getTestRandom4File ();
164+ bool extractSuccess = file.save (outputFilePath.c_str ());
165+ ASSERT_TRUE (extractSuccess);
166+
167+ // assert content is the same
168+ std::string reason;
169+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
170+ ASSERT_TRUE (equal) << reason.c_str ();
171+ }
172+
173+ TEST_F (TestExtraction, testRandom5)
174+ {
175+ static const std::string expectedFilePath = getExpectedFilePath ();
176+ static const std::string outputFilePath = getActualFilePath ();
177+
178+ const bin2cpp::File & file = bin2cpp::getTestRandom5File ();
179+ bool extractSuccess = file.save (outputFilePath.c_str ());
180+ ASSERT_TRUE (extractSuccess);
181+
182+ // assert content is the same
183+ std::string reason;
184+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
185+ ASSERT_TRUE (equal) << reason.c_str ();
186+ }
187+
188+ TEST_F (TestExtraction, testRandom6)
189+ {
190+ static const std::string expectedFilePath = getExpectedFilePath ();
191+ static const std::string outputFilePath = getActualFilePath ();
192+
193+ const bin2cpp::File & file = bin2cpp::getTestRandom6File ();
194+ bool extractSuccess = file.save (outputFilePath.c_str ());
195+ ASSERT_TRUE (extractSuccess);
196+
197+ // assert content is the same
198+ std::string reason;
199+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
200+ ASSERT_TRUE (equal) << reason.c_str ();
201+ }
202+
203+ TEST_F (TestExtraction, testRandom7)
204+ {
205+ static const std::string expectedFilePath = getExpectedFilePath ();
206+ static const std::string outputFilePath = getActualFilePath ();
207+
208+ const bin2cpp::File & file = bin2cpp::getTestRandom7File ();
209+ bool extractSuccess = file.save (outputFilePath.c_str ());
210+ ASSERT_TRUE (extractSuccess);
211+
212+ // assert content is the same
213+ std::string reason;
214+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
215+ ASSERT_TRUE (equal) << reason.c_str ();
216+ }
217+
218+ TEST_F (TestExtraction, testRandom8)
219+ {
220+ static const std::string expectedFilePath = getExpectedFilePath ();
221+ static const std::string outputFilePath = getActualFilePath ();
222+
223+ const bin2cpp::File & file = bin2cpp::getTestRandom8File ();
224+ bool extractSuccess = file.save (outputFilePath.c_str ());
225+ ASSERT_TRUE (extractSuccess);
226+
227+ // assert content is the same
228+ std::string reason;
229+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
230+ ASSERT_TRUE (equal) << reason.c_str ();
231+ }
232+
151233TEST_F (TestExtraction, testSequential10MB)
152234{
153235 static const std::string expectedFilePath = getExpectedFilePath ();
@@ -163,6 +245,36 @@ TEST_F(TestExtraction, testSequential10MB)
163245 ASSERT_TRUE (equal) << reason.c_str ();
164246}
165247
248+ TEST_F (TestExtraction, testIssue12)
249+ {
250+ static const std::string expectedFilePath = getExpectedFilePath ();
251+ static const std::string outputFilePath = getActualFilePath ();
252+
253+ const bin2cpp::File & file = bin2cpp::getTestIssue12File ();
254+ bool extractSuccess = file.save (outputFilePath.c_str ());
255+ ASSERT_TRUE (extractSuccess);
256+
257+ // assert content is the same
258+ std::string reason;
259+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
260+ ASSERT_TRUE (equal) << reason.c_str ();
261+ }
262+
263+ TEST_F (TestExtraction, testIssue12Mini)
264+ {
265+ static const std::string expectedFilePath = getExpectedFilePath ();
266+ static const std::string outputFilePath = getActualFilePath ();
267+
268+ const bin2cpp::File & file = bin2cpp::getTestIssue12MiniFile ();
269+ bool extractSuccess = file.save (outputFilePath.c_str ());
270+ ASSERT_TRUE (extractSuccess);
271+
272+ // assert content is the same
273+ std::string reason;
274+ bool equal = hlp.isFileEquals (expectedFilePath.c_str (), outputFilePath.c_str (), reason);
275+ ASSERT_TRUE (equal) << reason.c_str ();
276+ }
277+
166278TEST_F (TestExtraction, testIssue13)
167279{
168280 static const std::string expectedFilePath = getExpectedFilePath ();
0 commit comments