Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: testing/test_support.h

Issue 1666663004: Add unit tests for ascii85 and hex decoders. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/test_support.h
diff --git a/testing/test_support.h b/testing/test_support.h
index f59d5440e77421ba6af13e08f71ab5655565e186..3c7ffe56878e15ece7ce3daad507d98177ded36a 100644
--- a/testing/test_support.h
+++ b/testing/test_support.h
@@ -18,6 +18,35 @@
namespace pdfium {
+#define STR_TEST_CASE(input_literal, expected_literal) \
+ { \
+ (const unsigned char*) input_literal, sizeof(input_literal) - 1, \
+ (const unsigned char*)expected_literal, sizeof(expected_literal) - 1 \
+ }
+
+#define DECODE_TEST_CASE(input_literal, expected_literal, processed_size) \
+ { \
+ (const unsigned char*) input_literal, sizeof(input_literal) - 1, \
+ (const unsigned char*)expected_literal, sizeof(expected_literal) - 1, \
+ processed_size \
+ }
+
+struct StrFuncTestData {
+ const unsigned char* input;
+ unsigned int input_size;
+ const unsigned char* expected;
+ unsigned int expected_size;
+};
+
+struct DecodeTestData {
+ const unsigned char* input;
+ unsigned int input_size;
+ const unsigned char* expected;
+ unsigned int expected_size;
+ // The size of input string being processed.
+ unsigned int processed_size;
+};
+
// Used with std::unique_ptr to free() objects that can't be deleted.
struct FreeDeleter {
inline void operator()(void* ptr) const { free(ptr); }
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698