MCPcopy Create free account
hub / github.com/apple/coremltools / IsCorrectDataImpl

Function IsCorrectDataImpl

mlmodel/tests/MILBlob/StorageWriterTests.cpp:65–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64template <typename T>
65[[nodiscard]] bool IsCorrectDataImpl(const std::string& filePath, uint64_t offset, Util::Span<const T> expectedSpan)
66{
67 blob_metadata metadata;
68 TestUtil::ReadData<blob_metadata>(filePath, metadata, offset);
69
70 std::vector<T> output(expectedSpan.Size());
71 auto outputSpan = Util::MakeSpan(output);
72 TestUtil::ReadBlobFile<T>(filePath, metadata.offset, outputSpan);
73
74 return outputSpan.Size() == expectedSpan.Size() &&
75 std::equal(outputSpan.begin(), outputSpan.end(), expectedSpan.begin());
76}
77
78template <typename T>
79[[nodiscard]] bool IsCorrectSubByteData(const std::string& filePath, uint64_t offset, Util::Span<const T> expectedSpan)

Callers 1

IsCorrectDataFunction · 0.85

Calls 4

equalFunction · 0.50
SizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected