Use DecodeTestData::input_span() to avoid UNSAFE_TODOs
Pre-existing mechanism. Use it.
Change-Id: I48422669900f05bf05d74772b4eda3f1a09d0ddc
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/133271
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/parser/fpdf_parser_decode_unittest.cpp b/core/fpdfapi/parser/fpdf_parser_decode_unittest.cpp
index 9802a79..aafc357 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode_unittest.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode_unittest.cpp
@@ -313,8 +313,7 @@
STR_IN_OUT_CASE("12AcED3c3456", "\x12\xac\xed\x3c\x34\x56", 12),
};
for (const auto& test_case : kTestData) {
- DataAndBytesConsumed result = HexDecode(
- UNSAFE_TODO(pdfium::span(test_case.input, test_case.input_size)));
+ DataAndBytesConsumed result = HexDecode(test_case.input_span());
EXPECT_EQ(test_case.processed_size, result.bytes_consumed)
<< "for case " << test_case.input;
EXPECT_THAT(result.data, ElementsAreArray(test_case.expected_span()))
diff --git a/core/fxcodec/flate/flatemodule_unittest.cpp b/core/fxcodec/flate/flatemodule_unittest.cpp
index 7613929..480b8ba 100644
--- a/core/fxcodec/flate/flatemodule_unittest.cpp
+++ b/core/fxcodec/flate/flatemodule_unittest.cpp
@@ -5,7 +5,6 @@
#include "core/fxcodec/flate/flatemodule.h"
#include "core/fxcodec/data_and_bytes_consumed.h"
-#include "core/fxcrt/compiler_specific.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/test_support.h"
@@ -38,8 +37,7 @@
size_t i = 0;
for (const pdfium::DecodeTestData& data : flate_decode_cases) {
DataAndBytesConsumed result = FlateModule::FlateOrLZWDecode(
- false, UNSAFE_TODO(pdfium::span(data.input, data.input_size)), false, 0,
- 0, 0, 0, 0);
+ false, data.input_span(), false, 0, 0, 0, 0, 0);
EXPECT_EQ(data.processed_size, result.bytes_consumed) << " for case " << i;
EXPECT_THAT(result.data, ElementsAreArray(data.expected_span()))
<< " for case " << i;