Spanification of src/dawn/tests/white_box/QueryInternalShaderTests.cpp, etc. This is the result of running the automatic spanification on linux and updating code to use and pass spans where size is known. The original patch was fully automated using script: //tools/clang/spanify/rewrite-multiple-platforms.sh -platforms=linux Then refined with jetski-cli and at last manually refined Original patch: patch_34.txt Bug: 501143858 Change-Id: Iad180be64f04b8f1b7c370126a80809c2e7fb98c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/327815 Commit-Queue: Daniel Angulo <angdaniel@google.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/src/dawn/tests/white_box/QueryInternalShaderTests.cpp b/src/dawn/tests/white_box/QueryInternalShaderTests.cpp index 86d986e..728f85e 100644 --- a/src/dawn/tests/white_box/QueryInternalShaderTests.cpp +++ b/src/dawn/tests/white_box/QueryInternalShaderTests.cpp
@@ -31,6 +31,7 @@ #include "src/dawn/tests/DawnTest.h" #include "src/dawn/utils/WGPUHelpers.h" #include "src/utils/compiler.h" +#include "src/utils/span.h" namespace dawn { namespace { @@ -49,10 +50,8 @@ public: ~InternalShaderExpectation() override = default; - InternalShaderExpectation(const uint64_t* values, - const unsigned int count, - const uint32_t quantizationMask) { - mExpected.assign(values, DAWN_UNSAFE_TODO(values + count)); + InternalShaderExpectation(dawn::Span<const uint64_t> values, const uint32_t quantizationMask) { + mExpected.assign(values.begin(), values.end()); mQuantizationMask = quantizationMask; } @@ -206,8 +205,7 @@ GetExpectedResults(timestampValues, start, firstQuery, queryCount, period); EXPECT_BUFFER(timestampsBuffer, 0, size, - new InternalShaderExpectation(expected.data(), size / sizeof(uint64_t), - quantizationMask)) + new InternalShaderExpectation(expected, quantizationMask)) << "Conversion test for period:" << period << " firstQuery:" << firstQuery << " queryCount:" << queryCount << " destinationOffset:" << destinationOffset << " quantizationMask: 0x" << std::hex << quantizationMask;