From 0f5d07e64332fb776ce8e636efe05c4272cb98a1 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Tue, 27 Mar 2018 11:48:10 -0400 Subject: [PATCH] Added a check for BZip2 decompression size --- testing/adios2/transform/TestBZip2Wrapper.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/testing/adios2/transform/TestBZip2Wrapper.cpp b/testing/adios2/transform/TestBZip2Wrapper.cpp index b1a1fc6b4b..f466bd9c95 100644 --- a/testing/adios2/transform/TestBZip2Wrapper.cpp +++ b/testing/adios2/transform/TestBZip2Wrapper.cpp @@ -20,18 +20,18 @@ class ADIOSBZip2Wrapper : public ::testing::Test TEST_F(ADIOSBZip2Wrapper, UInt100) { /** Application variable uints from 0 to 1000 */ - std::vector myUInts(100); + std::vector myUInts(100); std::iota(myUInts.begin(), myUInts.end(), 0.f); const std::size_t Nx = myUInts.size(); - const std::size_t inputBytes = Nx * sizeof(unsigned int); + const std::size_t inputBytes = Nx * sizeof(uint32_t); // Define ADIOS variable - auto &var_UInt = io.DefineVariable("myUInts", {}, {}, {Nx}, - adios2::ConstantDims); + auto &var_UInt = io.DefineVariable("myUInts", {}, {}, {Nx}, + adios2::ConstantDims); // Verify the return type is as expected ::testing::StaticAssertTypeEq &>(); + adios2::Variable &>(); // Define bzip2 transform adios2::Operator &adiosBZip2 = @@ -53,11 +53,11 @@ TEST_F(ADIOSBZip2Wrapper, UInt100) compressedBuffer.resize(compressedSize); // Allocate original data size - std::vector decompressedBuffer(Nx); + std::vector decompressedBuffer(Nx); size_t decompressedSize = adiosBZip2.Decompress( compressedBuffer.data(), compressedSize, decompressedBuffer.data(), - decompressedBuffer.size() * sizeof(unsigned int)); - ASSERT_EQ(decompressedSize, Nx); + decompressedBuffer.size() * sizeof(uint32_t)); + ASSERT_EQ(decompressedSize, inputBytes); // testing data recovery for (size_t i = 0; i < Nx; ++i)