diff options
23 files changed, 3 insertions, 103 deletions
@@ -230,8 +230,6 @@ static_library("pdfium") { static_library("test_support") { testonly = true sources = [ - "testing/fx_string_testhelpers.cpp", - "testing/fx_string_testhelpers.h", "testing/test_support.cpp", "testing/test_support.h", "testing/utils/path_service.cpp", diff --git a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp index bb3cf15a0f..22ea62d03a 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp +++ b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_basic.h" #include "testing/embedder_test.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" diff --git a/core/fxcodec/codec/fx_codec_a85_unittest.cpp b/core/fxcodec/codec/fx_codec_a85_unittest.cpp index 78f9bd8fcc..5e40548bf2 100644 --- a/core/fxcodec/codec/fx_codec_a85_unittest.cpp +++ b/core/fxcodec/codec/fx_codec_a85_unittest.cpp @@ -8,7 +8,6 @@ #include "core/fxcodec/codec/ccodec_basicmodule.h" #include "core/fxcodec/fx_codec.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" TEST(fxcodec, A85TestBadInputs) { diff --git a/core/fxcodec/codec/fx_codec_jpx_unittest.cpp b/core/fxcodec/codec/fx_codec_jpx_unittest.cpp index 2acb76c355..6d1e31a0ee 100644 --- a/core/fxcodec/codec/fx_codec_jpx_unittest.cpp +++ b/core/fxcodec/codec/fx_codec_jpx_unittest.cpp @@ -7,7 +7,6 @@ #include <limits> #include "core/fxcodec/codec/codec_int.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" static const OPJ_OFF_T kSkipError = static_cast<OPJ_OFF_T>(-1); diff --git a/core/fxcodec/codec/fx_codec_rle_unittest.cpp b/core/fxcodec/codec/fx_codec_rle_unittest.cpp index f9a4b3fcb7..7b0af90819 100644 --- a/core/fxcodec/codec/fx_codec_rle_unittest.cpp +++ b/core/fxcodec/codec/fx_codec_rle_unittest.cpp @@ -9,7 +9,6 @@ #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fxcodec/codec/ccodec_basicmodule.h" #include "core/fxcodec/fx_codec.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" TEST(fxcodec, RLETestBadInputs) { diff --git a/core/fxcrt/cfx_bytestring_unittest.cpp b/core/fxcrt/cfx_bytestring_unittest.cpp index c53b90025b..609f89201b 100644 --- a/core/fxcrt/cfx_bytestring_unittest.cpp +++ b/core/fxcrt/cfx_bytestring_unittest.cpp @@ -3,11 +3,11 @@ // found in the LICENSE file. #include "core/fxcrt/cfx_bytestring.h" +#include "core/fxcrt/fx_string.h" #include <algorithm> #include <vector> -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/base/stl_util.h" diff --git a/core/fxcrt/cfx_maybe_owned_unittest.cpp b/core/fxcrt/cfx_maybe_owned_unittest.cpp index 8f513a358d..a716182ce5 100644 --- a/core/fxcrt/cfx_maybe_owned_unittest.cpp +++ b/core/fxcrt/cfx_maybe_owned_unittest.cpp @@ -8,7 +8,6 @@ #include <utility> #include "core/fxcrt/fx_memory.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/base/ptr_util.h" diff --git a/core/fxcrt/cfx_observable_unittest.cpp b/core/fxcrt/cfx_observable_unittest.cpp index 3c0fabb13e..f7c78c1112 100644 --- a/core/fxcrt/cfx_observable_unittest.cpp +++ b/core/fxcrt/cfx_observable_unittest.cpp @@ -7,7 +7,6 @@ #include <utility> #include <vector> -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/core/fxcrt/cfx_retain_ptr_unittest.cpp b/core/fxcrt/cfx_retain_ptr_unittest.cpp index fc0309467c..eae542fe88 100644 --- a/core/fxcrt/cfx_retain_ptr_unittest.cpp +++ b/core/fxcrt/cfx_retain_ptr_unittest.cpp @@ -7,7 +7,6 @@ #include <utility> #include <vector> -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/core/fxcrt/cfx_shared_copy_on_write_unittest.cpp b/core/fxcrt/cfx_shared_copy_on_write_unittest.cpp index b0205d899b..797837465b 100644 --- a/core/fxcrt/cfx_shared_copy_on_write_unittest.cpp +++ b/core/fxcrt/cfx_shared_copy_on_write_unittest.cpp @@ -7,7 +7,6 @@ #include <map> #include <string> -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/core/fxcrt/cfx_string_pool_template_unittest.cpp b/core/fxcrt/cfx_string_pool_template_unittest.cpp index d0f5fbe96d..a4e603c8fa 100644 --- a/core/fxcrt/cfx_string_pool_template_unittest.cpp +++ b/core/fxcrt/cfx_string_pool_template_unittest.cpp @@ -4,7 +4,6 @@ #include "core/fxcrt/cfx_string_pool_template.h" #include "core/fxcrt/fx_string.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" TEST(fxcrt, ByteStringPool) { diff --git a/core/fxcrt/cfx_unowned_ptr_unittest.cpp b/core/fxcrt/cfx_unowned_ptr_unittest.cpp index 6218679fa2..46230e7ebd 100644 --- a/core/fxcrt/cfx_unowned_ptr_unittest.cpp +++ b/core/fxcrt/cfx_unowned_ptr_unittest.cpp @@ -7,7 +7,6 @@ #include <utility> #include <vector> -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/core/fxcrt/cfx_weak_ptr_unittest.cpp b/core/fxcrt/cfx_weak_ptr_unittest.cpp index 47f63c35b2..aafcf16b3d 100644 --- a/core/fxcrt/cfx_weak_ptr_unittest.cpp +++ b/core/fxcrt/cfx_weak_ptr_unittest.cpp @@ -8,7 +8,6 @@ #include <utility> #include "core/fxcrt/fx_memory.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/core/fxcrt/cfx_widestring_unittest.cpp b/core/fxcrt/cfx_widestring_unittest.cpp index f5a0e12560..165b43add6 100644 --- a/core/fxcrt/cfx_widestring_unittest.cpp +++ b/core/fxcrt/cfx_widestring_unittest.cpp @@ -3,11 +3,11 @@ // found in the LICENSE file. #include "core/fxcrt/cfx_widestring.h" +#include "core/fxcrt/fx_string.h" #include <algorithm> #include <vector> -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" TEST(fxcrt, WideStringOperatorSubscript) { diff --git a/core/fxcrt/fx_basic_util_unittest.cpp b/core/fxcrt/fx_basic_util_unittest.cpp index 471c6deeb3..f4e3f794d3 100644 --- a/core/fxcrt/fx_basic_util_unittest.cpp +++ b/core/fxcrt/fx_basic_util_unittest.cpp @@ -5,7 +5,6 @@ #include <limits> #include "core/fxcrt/fx_basic.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/core/fxcrt/fx_system_unittest.cpp b/core/fxcrt/fx_system_unittest.cpp index 9182fdf7d9..7747086b1b 100644 --- a/core/fxcrt/fx_system_unittest.cpp +++ b/core/fxcrt/fx_system_unittest.cpp @@ -4,8 +4,8 @@ #include <limits> +#include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" // Unit test covering cases where PDFium replaces well-known library diff --git a/core/fxge/skia/fx_skia_device_unittest.cpp b/core/fxge/skia/fx_skia_device_unittest.cpp index 99b76d2109..94d9a0f2cf 100644 --- a/core/fxge/skia/fx_skia_device_unittest.cpp +++ b/core/fxge/skia/fx_skia_device_unittest.cpp @@ -9,7 +9,6 @@ #include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/fsdk_define.h" #include "public/fpdfview.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkPictureRecorder.h" diff --git a/fpdfsdk/fpdfdoc_embeddertest.cpp b/fpdfsdk/fpdfdoc_embeddertest.cpp index 2472db9746..f069ec2631 100644 --- a/fpdfsdk/fpdfdoc_embeddertest.cpp +++ b/fpdfsdk/fpdfdoc_embeddertest.cpp @@ -10,7 +10,6 @@ #include "public/fpdf_edit.h" #include "public/fpdfview.h" #include "testing/embedder_test.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" diff --git a/fpdfsdk/fpdfsave_embeddertest.cpp b/fpdfsdk/fpdfsave_embeddertest.cpp index 918727027f..e5d05c98df 100644 --- a/fpdfsdk/fpdfsave_embeddertest.cpp +++ b/fpdfsdk/fpdfsave_embeddertest.cpp @@ -11,7 +11,6 @@ #include "public/fpdf_ppo.h" #include "public/fpdfview.h" #include "testing/embedder_test.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gmock/include/gmock/gmock-matchers.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" @@ -31,7 +30,6 @@ TEST_F(FPDFSaveEmbedderTest, SaveSimpleDocWithVersion) { EXPECT_THAT(GetString(), testing::StartsWith("%PDF-1.4\r\n")); EXPECT_EQ(843u, GetString().length()); } - TEST_F(FPDFSaveEmbedderTest, SaveSimpleDocWithBadVersion) { EXPECT_TRUE(OpenDocument("hello_world.pdf")); EXPECT_TRUE(FPDF_SaveWithVersion(document(), this, 0, -1)); diff --git a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp index b4b9396d84..478fcf50df 100644 --- a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp +++ b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp @@ -4,7 +4,6 @@ #include "core/fxcrt/fx_basic.h" #include "fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" TEST(PDF417HighLevelEncoder, EncodeHighLevel) { diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp deleted file mode 100644 index 00a13f5b57..0000000000 --- a/testing/fx_string_testhelpers.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "testing/fx_string_testhelpers.h" - -#include <iomanip> -#include <ios> -#include <string> - -namespace { - -template <typename T> -std::ostream& output_string(std::ostream& out, const T& str) { - out << std::hex << std::setfill('0') << '"'; - // This function is used for FX strings whose length is defined as int. - for (int i = 0; i < str.GetLength(); ++i) { - unsigned int c = str.GetAt(i); - if (c >= 0x20 && c < 0x7F) { - out << static_cast<char>(c); - } else if (sizeof(typename T::CharType) == 1) { - out << "\\x" << std::setw(2) << c << std::setw(0); - } else if (c < 0x10000) { - out << "\\u" << std::setw(4) << c << std::setw(0); - } else { - out << "<invalid>"; - } - } - out << '"' << std::dec << std::setfill(' '); - return out; -} - -} // namespace - -std::ostream& operator<<(std::ostream& out, const CFX_ByteStringC& str) { - return output_string(out, str); -} - -std::ostream& operator<<(std::ostream& out, const CFX_ByteString& str) { - return output_string(out, str); -} - -std::ostream& operator<<(std::ostream& out, const CFX_WideStringC& str) { - return output_string(out, str); -} - -std::ostream& operator<<(std::ostream& out, const CFX_WideString& str) { - return output_string(out, str); -} - -std::ostream& operator<<(std::ostream& os, const CFX_DateTime& dt) { - os << dt.GetYear() << "-" << std::to_string(dt.GetMonth()) << "-" - << std::to_string(dt.GetDay()) << " " << std::to_string(dt.GetHour()) - << ":" << std::to_string(dt.GetMinute()) << ":" - << std::to_string(dt.GetSecond()) << "." - << std::to_string(dt.GetMillisecond()); - return os; -} diff --git a/testing/fx_string_testhelpers.h b/testing/fx_string_testhelpers.h deleted file mode 100644 index caa233049a..0000000000 --- a/testing/fx_string_testhelpers.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef TESTING_FX_STRING_TESTHELPERS_H_ -#define TESTING_FX_STRING_TESTHELPERS_H_ - -#include <ostream> - -#include "core/fxcrt/cfx_datetime.h" -#include "core/fxcrt/fx_string.h" - -// Output stream operator so GTEST macros work with FX strings. -std::ostream& operator<<(std::ostream& out, const CFX_ByteStringC& str); -std::ostream& operator<<(std::ostream& out, const CFX_ByteString& str); -std::ostream& operator<<(std::ostream& out, const CFX_WideStringC& str); -std::ostream& operator<<(std::ostream& out, const CFX_WideString& str); - -// Output stream operator so GTEST macros work with CFX_DateTime objects. -std::ostream& operator<<(std::ostream& os, const CFX_DateTime& dt); - -#endif // TESTING_FX_STRING_TESTHELPERS_H_ diff --git a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp index 3adcedf7b2..2af1507635 100644 --- a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp +++ b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp @@ -11,7 +11,6 @@ #include <memory> #include "core/fpdfapi/cpdf_modulemgr.h" -#include "testing/fx_string_testhelpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" #include "third_party/base/ptr_util.h" |