Fix rounding issue in unittest for block calculation.
parent
810fc405a8
commit
337990510c
|
@ -99,6 +99,9 @@ TEST_F( IOStreamBufferTest, readlineTest ) {
|
||||||
TestDefaultIOStream myStream( fs, buffer );
|
TestDefaultIOStream myStream( fs, buffer );
|
||||||
size_t size( myStream.FileSize() );
|
size_t size( myStream.FileSize() );
|
||||||
size_t numBlocks( size / myBuffer.cacheSize() );
|
size_t numBlocks( size / myBuffer.cacheSize() );
|
||||||
|
if ( size % myBuffer.cacheSize() > 0 ) {
|
||||||
|
numBlocks++;
|
||||||
|
}
|
||||||
EXPECT_TRUE( myBuffer.open( &myStream ) );
|
EXPECT_TRUE( myBuffer.open( &myStream ) );
|
||||||
EXPECT_EQ( numBlocks, myBuffer.getNumBlocks() );
|
EXPECT_EQ( numBlocks, myBuffer.getNumBlocks() );
|
||||||
EXPECT_TRUE( myBuffer.close() );
|
EXPECT_TRUE( myBuffer.close() );
|
||||||
|
|
Loading…
Reference in New Issue