Skip to content

Commit

Permalink
Fix some sign-comparison warnings in tests
Browse files Browse the repository at this point in the history
The new Catch2 version is structured so as to surface these warnings
that previously did not occur.  So they need to be resolved.
  • Loading branch information
jbytheway committed Apr 21, 2020
1 parent 0135827 commit 3525bed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/list_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ TEST_CASE( "list insert and erase", "[list]" )
}

SECTION( "erase randomly till half empty" ) {
int count = 0;
size_t count = 0;
do {
for( cata::list<int>::iterator it = test_list.begin(); it != test_list.end(); ) {
if( ( xor_rand() & 7 ) == 0 ) {
Expand All @@ -316,7 +316,7 @@ TEST_CASE( "list insert and erase", "[list]" )

CHECK( test_list.size() == 500000 - count );

for( int i = 0; i < count; i++ ) {
for( size_t i = 0; i < count; i++ ) {
test_list.push_front( 1 );
}

Expand Down Expand Up @@ -432,7 +432,7 @@ TEST_CASE( "list insert and erase", "[list]" )
CHECK( prev_capacity != test_list.capacity() );
CHECK( test_list.capacity() == 1000 );

int count = 0;
size_t count = 0;
for( int loop1 = 0; loop1 < 50000; loop1++ ) {
for( int loop = 0; loop < 10; loop++ ) {
if( ( xor_rand() & 7 ) == 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion tests/visitable_remove_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ TEST_CASE( "visitable_remove", "[visitable]" )
REQUIRE( count_items( sel, liquid_id ) == count - our );
}
THEN( "the correct number of items were removed" ) {
REQUIRE( del.size() == our );
REQUIRE( static_cast<int>( del.size() ) == our );

AND_THEN( "the removed items were all bottles" ) {
CHECK( std::all_of( del.begin(), del.end(), [&container_id]( const item & e ) {
Expand Down

0 comments on commit 3525bed

Please sign in to comment.