1 // Copyright 2015 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TESTING_TEST_SUPPORT_H_ 6 #define TESTING_TEST_SUPPORT_H_ 7 8 #include <stdint.h> 9 10 namespace pdfium { 11 12 #define STR_IN_TEST_CASE(input_literal, ...) \ 13 { \ 14 reinterpret_cast<const unsigned char*>(input_literal), \ 15 sizeof(input_literal) - 1, __VA_ARGS__ \ 16 } 17 18 #define STR_IN_OUT_CASE(input_literal, expected_literal, ...) \ 19 { \ 20 reinterpret_cast<const unsigned char*>(input_literal), \ 21 sizeof(input_literal) - 1, \ 22 reinterpret_cast<const unsigned char*>(expected_literal), \ 23 sizeof(expected_literal) - 1, __VA_ARGS__ \ 24 } 25 26 struct StrFuncTestData { 27 const unsigned char* input; 28 uint32_t input_size; 29 const unsigned char* expected; 30 uint32_t expected_size; 31 }; 32 33 struct DecodeTestData { 34 const unsigned char* input; 35 uint32_t input_size; 36 const unsigned char* expected; 37 uint32_t expected_size; 38 // The size of input string being processed. 39 uint32_t processed_size; 40 }; 41 42 struct NullTermWstrFuncTestData { 43 const wchar_t* input; 44 const wchar_t* expected; 45 }; 46 47 } // namespace pdfium 48 49 #endif // TESTING_TEST_SUPPORT_H_ 50