| 754 | } |
| 755 | |
| 756 | void GzipFile(const char *in, const char *out, int deflate_level) |
| 757 | { |
| 758 | // FileSource(in, true, new Gzip(new FileSink(out), deflate_level)); |
| 759 | |
| 760 | // use a filter graph to compare decompressed data with original |
| 761 | // |
| 762 | // Source ----> Gzip ------> Sink |
| 763 | // \ | |
| 764 | // \ Gunzip |
| 765 | // \ | |
| 766 | // \ v |
| 767 | // > ComparisonFilter |
| 768 | |
| 769 | EqualityComparisonFilter comparison; |
| 770 | |
| 771 | Gunzip gunzip(new ChannelSwitch(comparison, "0")); |
| 772 | gunzip.SetAutoSignalPropagation(0); |
| 773 | |
| 774 | FileSink sink(out); |
| 775 | |
| 776 | ChannelSwitch *cs; |
| 777 | Gzip gzip(cs = new ChannelSwitch(sink), deflate_level); |
| 778 | cs->AddDefaultRoute(gunzip); |
| 779 | |
| 780 | cs = new ChannelSwitch(gzip); |
| 781 | cs->AddDefaultRoute(comparison, "1"); |
| 782 | FileSource source(in, true, cs); |
| 783 | |
| 784 | comparison.ChannelMessageSeriesEnd("0"); |
| 785 | comparison.ChannelMessageSeriesEnd("1"); |
| 786 | } |
| 787 | |
| 788 | void GunzipFile(const char *in, const char *out) |
| 789 | { |
no test coverage detected