summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-07-21 14:31:21 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-21 22:17:19 +0000
commitd2be646ae1655ac702c5f304d546a2eb32ad2c54 (patch)
tree32afb8cce624777ce279fbc15186d083c2630c4e /testing
parent22bf7a5f796155ee3d1a4ea32e237a6d2034996d (diff)
downloadpdfium-d2be646ae1655ac702c5f304d546a2eb32ad2c54.tar.xz
Clean up pdfium_test.cc
- Move several blocks out of RenderPdf(). - Add an anonymous namespace. - Check fwrite() results. - Fix nits. Change-Id: Ief0ddd5e49455d68b92d40674294dc9134adf86c Reviewed-on: https://pdfium-review.googlesource.com/8650 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Jane Liu <janeliulwq@google.com> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'testing')
-rw-r--r--testing/test_support.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index e5c3ab45a0..0ebb7478c2 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -105,10 +105,9 @@ std::unique_ptr<char, pdfium::FreeDeleter> GetFileContents(const char* filename,
}
std::string GetPlatformString(FPDF_WIDESTRING wstr) {
- return std::string(
- CFX_WideString::FromUTF16LE(wstr, CFX_WideString::WStringLength(wstr))
- .UTF8Encode()
- .c_str());
+ CFX_WideString wide_string =
+ CFX_WideString::FromUTF16LE(wstr, CFX_WideString::WStringLength(wstr));
+ return std::string(wide_string.UTF8Encode().c_str());
}
std::wstring GetPlatformWString(FPDF_WIDESTRING wstr) {