clear array initialization

This commit is contained in:
Alexandra Latysheva 2020-10-11 10:18:53 +00:00
parent 466259a985
commit 1d1c4b9579
3 changed files with 5 additions and 6 deletions

View File

@ -214,8 +214,7 @@ void TestWriting(const char* mode, int tiled, int height) {
for (int i = 0; i < (height + 15) / 16; ++i) {
std::array<uint8_t, kTileBufferSize> tilebuffer;
tilebuffer.fill(i);
sapi::v::Array<uint8_t> tilebuffer_(tilebuffer.data(),
kTileBufferSize);
sapi::v::Array<uint8_t> tilebuffer_(tilebuffer.data(), tilebuffer.size());
status_or_int = api.TIFFWriteEncodedTile(&tif, i, tilebuffer_.PtrBoth(),
kTileBufferSize);
@ -255,8 +254,8 @@ void TestWriting(const char* mode, int tiled, int height) {
uint8_t expected_c = static_cast<uint8_t>(i);
tilebuffer.fill(0);
sapi::v::Array<uint8_t> tilebuffer_(tilebuffer.data(),
kTileBufferSize);
sapi::v::Array<uint8_t> tilebuffer_(tilebuffer.data(), tilebuffer.size());
status_or_long = api.TIFFReadEncodedTile(
&tif2, i, tilebuffer_.PtrBoth(), kTileBufferSize);
ASSERT_THAT(status_or_long, IsOk())

View File

@ -51,7 +51,7 @@ TEST(SandboxTest, LongTag) {
ASSERT_THAT(sandbox.Init(), IsOk()) << "Couldn't initialize Sandboxed API";
std::array<uint8_t, kSamplePerPixel> buffer = {0, 127, 255};
sapi::v::Array<uint8_t> buffer_(buffer.data(), kSamplePerPixel);
sapi::v::Array<uint8_t> buffer_(buffer.data(), buffer.size());
absl::StatusOr<int> status_or_int;
absl::StatusOr<TIFF*> status_or_tif;

View File

@ -72,7 +72,7 @@ TEST(SandboxTest, ShortTag) {
ASSERT_THAT(sandbox.Init(), IsOk()) << "Couldn't initialize Sandboxed API";
std::array<uint8_t, kSamplePerPixel> buffer = {0, 127, 255};
sapi::v::Array<uint8_t> buffer_(buffer.data(), kSamplePerPixel);
sapi::v::Array<uint8_t> buffer_(buffer.data(), buffer.size());
absl::StatusOr<int> status_or_int;
absl::StatusOr<TIFF*> status_or_tif;