From 337990510c074a4a921c669676210a3cc250eed0 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Oct 2016 11:16:31 +0100 Subject: [PATCH] Fix rounding issue in unittest for block calculation. --- test/unit/utIOStreamBuffer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/unit/utIOStreamBuffer.cpp b/test/unit/utIOStreamBuffer.cpp index a6308fc7d..ded6c0eb7 100644 --- a/test/unit/utIOStreamBuffer.cpp +++ b/test/unit/utIOStreamBuffer.cpp @@ -99,6 +99,9 @@ TEST_F( IOStreamBufferTest, readlineTest ) { TestDefaultIOStream myStream( fs, buffer ); size_t size( myStream.FileSize() ); size_t numBlocks( size / myBuffer.cacheSize() ); + if ( size % myBuffer.cacheSize() > 0 ) { + numBlocks++; + } EXPECT_TRUE( myBuffer.open( &myStream ) ); EXPECT_EQ( numBlocks, myBuffer.getNumBlocks() ); EXPECT_TRUE( myBuffer.close() );