From 2038d01f222338a1cb76e2f01bcea18a81fff9e8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 31 Dec 2016 16:20:59 +0100 Subject: [PATCH] Unittest: fix compiler warning: unused variable. --- test/unit/utIOStreamBuffer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/unit/utIOStreamBuffer.cpp b/test/unit/utIOStreamBuffer.cpp index ded6c0eb7..aa70881a9 100644 --- a/test/unit/utIOStreamBuffer.cpp +++ b/test/unit/utIOStreamBuffer.cpp @@ -61,10 +61,10 @@ TEST_F( IOStreamBufferTest, creationTest ) { TEST_F( IOStreamBufferTest, accessCacheSizeTest ) { IOStreamBuffer myBuffer1; - EXPECT_NE( 0, myBuffer1.cacheSize() ); + EXPECT_NE( 0U, myBuffer1.cacheSize() ); IOStreamBuffer myBuffer2( 100 ); - EXPECT_EQ( 100, myBuffer2.cacheSize() ); + EXPECT_EQ( 100U, myBuffer2.cacheSize() ); } TEST_F( IOStreamBufferTest, open_close_Test ) { @@ -77,6 +77,7 @@ TEST_F( IOStreamBufferTest, open_close_Test ) { tmpnam( buffer ); std::FILE *fs( std::fopen( buffer, "w+" ) ); size_t written( std::fwrite( buffer, 1, sizeof( char ) * L_tmpnam, fs ) ); + EXPECT_NE( 0U, written ); std::fflush( fs ); TestDefaultIOStream myStream( fs, buffer ); @@ -91,10 +92,11 @@ TEST_F( IOStreamBufferTest, readlineTest ) { tmpnam( buffer ); std::FILE *fs( std::fopen( buffer, "w+" ) ); size_t written( std::fwrite( buffer, 1, sizeof( char ) * L_tmpnam, fs ) ); + EXPECT_NE( 0U, written ); std::fflush( fs ); IOStreamBuffer myBuffer( 26 ); - EXPECT_EQ( 26, myBuffer.cacheSize() ); + EXPECT_EQ( 26U, myBuffer.cacheSize() ); TestDefaultIOStream myStream( fs, buffer ); size_t size( myStream.FileSize() ); @@ -110,3 +112,4 @@ TEST_F( IOStreamBufferTest, readlineTest ) { TEST_F( IOStreamBufferTest, accessBlockIndexTest ) { } +