Draw space controller

This commit is contained in:
Jakub Melka
2019-01-20 17:55:06 +01:00
parent a9292a4c02
commit 7631265ba4
11 changed files with 458 additions and 17 deletions

View File

@@ -22,6 +22,7 @@
#include "pdfparser.h"
#include "pdfconstants.h"
#include "pdfflatmap.h"
#include "pdfstreamfilters.h"
#include <regex>
@@ -44,6 +45,7 @@ private slots:
void test_invalid_input();
void test_header_regexp();
void test_flat_map();
void test_lzw_filter();
private:
void scanWholeStream(const char* stream);
@@ -295,6 +297,17 @@ void LexicalAnalyzerTest::test_flat_map()
}
}
void LexicalAnalyzerTest::test_lzw_filter()
{
// This example is from PDF 1.7 Reference
QByteArray byteArray = QByteArray::fromHex("800B6050220C0C8501");
pdf::PDFLzwDecodeFilter filter;
QByteArray decoded = filter.apply(byteArray, nullptr, pdf::PDFObject());
QByteArray valid = "-----A---B";
QCOMPARE(decoded, valid);
}
void LexicalAnalyzerTest::scanWholeStream(const char* stream)
{
pdf::PDFLexicalAnalyzer analyzer(stream, stream + strlen(stream));