Introduce ScopedFPDFWideString for use in tests.

It is equivalent to std::unique_ptr<FPDF_WCHAR, pdfium::FreeDeleter>.
Use it to shorten the type returned by GetFPDFWideString(). The use of
FPDF_WCHAR also makes the linter complain less about the use of unsigned
short.

Change-Id: Id32c284375151684f8457d84c4faa3fcb514f6ca
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/52871
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp
index e13bd2d..8087e12 100644
--- a/testing/fx_string_testhelpers.cpp
+++ b/testing/fx_string_testhelpers.cpp
@@ -56,11 +56,9 @@
   return platform_string;
 }
 
-std::unique_ptr<unsigned short, pdfium::FreeDeleter> GetFPDFWideString(
-    const std::wstring& wstr) {
+ScopedFPDFWideString GetFPDFWideString(const std::wstring& wstr) {
   size_t length = sizeof(uint16_t) * (wstr.length() + 1);
-  std::unique_ptr<unsigned short, pdfium::FreeDeleter> result(
-      static_cast<unsigned short*>(malloc(length)));
+  ScopedFPDFWideString result(static_cast<FPDF_WCHAR*>(malloc(length)));
   pdfium::span<uint8_t> result_span(reinterpret_cast<uint8_t*>(result.get()),
                                     length);
   size_t i = 0;