@@ -599,49 +599,49 @@ void test20() {
599
599
assert (!entry2.isNull ());
600
600
601
601
{
602
- // Extract somedata with chunk of 2 bytes, which is not divisible by the file size (17 Bytes)
603
- std::ofstream ofUnzippedFile (" somedata.txt" );
604
- assert (static_cast <bool >(ofUnzippedFile));
605
- assert (entry.readContent (ofUnzippedFile, ZipArchive::CURRENT, 2 ) == 0 );
606
- ofUnzippedFile.close ();
607
-
608
- std::ifstream ifUnzippedFile (" somedata.txt" );
609
- assert (static_cast <bool >(ifUnzippedFile));
610
- std::string strSomedataText ((std::istreambuf_iterator<char >(ifUnzippedFile)), std::istreambuf_iterator<char >());
611
- assert (strSomedataText.compare (txtFile) == 0 );
612
- ifUnzippedFile.close ();
613
- assert (remove (" somedata.txt" ) == 0 );
602
+ // Extract somedata with chunk of 2 bytes, which is not divisible by the file size (17 Bytes)
603
+ std::ofstream ofUnzippedFile (" somedata.txt" );
604
+ assert (static_cast <bool >(ofUnzippedFile));
605
+ assert (entry.readContent (ofUnzippedFile, ZipArchive::CURRENT, 2 ) == 0 );
606
+ ofUnzippedFile.close ();
607
+
608
+ std::ifstream ifUnzippedFile (" somedata.txt" );
609
+ assert (static_cast <bool >(ifUnzippedFile));
610
+ std::string strSomedataText ((std::istreambuf_iterator<char >(ifUnzippedFile)), std::istreambuf_iterator<char >());
611
+ assert (strSomedataText.compare (txtFile) == 0 );
612
+ ifUnzippedFile.close ();
613
+ assert (remove (" somedata.txt" ) == 0 );
614
614
}
615
615
616
616
{
617
- // Extract somedata with chunk of 0 bytes (will be defaulted to 512KB).
618
- std::ofstream ofUnzippedFile (" somedata.txt" );
619
- assert (static_cast <bool >(ofUnzippedFile));
620
- assert (entry.readContent (ofUnzippedFile, ZipArchive::CURRENT, 0 ) == 0 );
621
- ofUnzippedFile.close ();
622
-
623
- std::ifstream ifUnzippedFile (" somedata.txt" );
624
- assert (static_cast <bool >(ifUnzippedFile));
625
- std::string strSomedataText ((std::istreambuf_iterator<char >(ifUnzippedFile)), std::istreambuf_iterator<char >());
626
- assert (strSomedataText.compare (txtFile) == 0 );
627
- ifUnzippedFile.close ();
628
- assert (remove (" somedata.txt" ) == 0 );
617
+ // Extract somedata with chunk of 0 bytes (will be defaulted to 512KB).
618
+ std::ofstream ofUnzippedFile (" somedata.txt" );
619
+ assert (static_cast <bool >(ofUnzippedFile));
620
+ assert (entry.readContent (ofUnzippedFile, ZipArchive::CURRENT, 0 ) == 0 );
621
+ ofUnzippedFile.close ();
622
+
623
+ std::ifstream ifUnzippedFile (" somedata.txt" );
624
+ assert (static_cast <bool >(ifUnzippedFile));
625
+ std::string strSomedataText ((std::istreambuf_iterator<char >(ifUnzippedFile)), std::istreambuf_iterator<char >());
626
+ assert (strSomedataText.compare (txtFile) == 0 );
627
+ ifUnzippedFile.close ();
628
+ assert (remove (" somedata.txt" ) == 0 );
629
629
}
630
630
631
631
{
632
- // Extract somedata2 with a chunk which is divisible by the size of the file (18 Bytes) to check that the modulo branch
633
- // is not accessed !
634
- std::ofstream ofUnzippedFile (" somedata2.txt" );
635
- assert (static_cast <bool >(ofUnzippedFile));
636
- assert (entry2.readContent (ofUnzippedFile, ZipArchive::CURRENT, 2 ) == 0 );
637
- ofUnzippedFile.close ();
638
-
639
- std::ifstream ifUnzippedFile (" somedata2.txt" );
640
- assert (static_cast <bool >(ifUnzippedFile));
641
- std::string strSomedataText ((std::istreambuf_iterator<char >(ifUnzippedFile)), std::istreambuf_iterator<char >());
642
- assert (strSomedataText.compare (txtFile2) == 0 );
643
- ifUnzippedFile.close ();
644
- assert (remove (" somedata2.txt" ) == 0 );
632
+ // Extract somedata2 with a chunk which is divisible by the size of the file (18 Bytes) to check that the modulo branch
633
+ // is not accessed !
634
+ std::ofstream ofUnzippedFile (" somedata2.txt" );
635
+ assert (static_cast <bool >(ofUnzippedFile));
636
+ assert (entry2.readContent (ofUnzippedFile, ZipArchive::CURRENT, 2 ) == 0 );
637
+ ofUnzippedFile.close ();
638
+
639
+ std::ifstream ifUnzippedFile (" somedata2.txt" );
640
+ assert (static_cast <bool >(ifUnzippedFile));
641
+ std::string strSomedataText ((std::istreambuf_iterator<char >(ifUnzippedFile)), std::istreambuf_iterator<char >());
642
+ assert (strSomedataText.compare (txtFile2) == 0 );
643
+ ifUnzippedFile.close ();
644
+ assert (remove (" somedata2.txt" ) == 0 );
645
645
}
646
646
647
647
z2.close ();
0 commit comments