Skip to content
Snippets Groups Projects
Commit 01630588 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

std: remove not needed casts in tests

parent b6a147ab
No related branches found
No related tags found
1 merge request!179C casts to C++ casts redesign
...@@ -54,9 +54,9 @@ TEST_CASE ( "Forward Tree", "[unit][std][container]" ) { ...@@ -54,9 +54,9 @@ TEST_CASE ( "Forward Tree", "[unit][std][container]" ) {
   
print_tree ( t2, ""); print_tree ( t2, "");
   
CHECK( ( char ) t2 ( 1, 1 ) == 'b' ); CHECK( t2 ( 1, 1 ) == 'b' );
t2 ( 1, 1 ) = 'c'; t2 ( 1, 1 ) = 'c';
CHECK( ( char ) t2 ( 1, 1 ) == 'c' ); CHECK( t2 ( 1, 1 ) == 'c' );
   
ext::forward_tree < char >::const_prefix_iterator beg = t2.prefix_begin ( ); ext::forward_tree < char >::const_prefix_iterator beg = t2.prefix_begin ( );
beg++; beg++;
......
...@@ -86,8 +86,8 @@ TEST_CASE ( "LinearSet", "[unit][std][container]" ) { ...@@ -86,8 +86,8 @@ TEST_CASE ( "LinearSet", "[unit][std][container]" ) {
std::set_difference (first.begin(), first.end(), second.begin(), second.end(), std::inserter(firstMinusSecond, firstMinusSecond.end())); std::set_difference (first.begin(), first.end(), second.begin(), second.end(), std::inserter(firstMinusSecond, firstMinusSecond.end()));
std::set_difference (second.begin(), second.end(), first.begin(), first.end(), std::inserter(secondMinusFirst, secondMinusFirst.end())); std::set_difference (second.begin(), second.end(), first.begin(), first.end(), std::inserter(secondMinusFirst, secondMinusFirst.end()));
   
CHECK(firstMinusSecond.size() == (size_t) 0u); CHECK(firstMinusSecond.size() == 0u);
CHECK(secondMinusFirst.size() == (size_t) 2u); CHECK(secondMinusFirst.size() == 2u);
} }
   
SECTION ( "Test3" ) { SECTION ( "Test3" ) {
......
...@@ -62,8 +62,8 @@ TEST_CASE ( "Set", "[unit][std][container]" ) { ...@@ -62,8 +62,8 @@ TEST_CASE ( "Set", "[unit][std][container]" ) {
std::set_difference (first.begin(), first.end(), second.begin(), second.end(), std::inserter(firstMinusSecond, firstMinusSecond.end())); std::set_difference (first.begin(), first.end(), second.begin(), second.end(), std::inserter(firstMinusSecond, firstMinusSecond.end()));
std::set_difference (second.begin(), second.end(), first.begin(), first.end(), std::inserter(secondMinusFirst, secondMinusFirst.end())); std::set_difference (second.begin(), second.end(), first.begin(), first.end(), std::inserter(secondMinusFirst, secondMinusFirst.end()));
   
CHECK(firstMinusSecond.size() == (size_t) 0u); CHECK(firstMinusSecond.size() == 0u);
CHECK(secondMinusFirst.size() == (size_t) 2u); CHECK(secondMinusFirst.size() == 2u);
} }
} }
   
......
...@@ -64,13 +64,13 @@ TEST_CASE ( "Tree", "[unit][std][container]" ) { ...@@ -64,13 +64,13 @@ TEST_CASE ( "Tree", "[unit][std][container]" ) {
   
print_tree ( t2, "" ); print_tree ( t2, "" );
   
CHECK ( ( char ) t2 ( ) == 'c' ); CHECK ( t2 ( ) == 'c' );
CHECK ( ( char ) t2 ( 0 ) == 'c' ); CHECK ( t2 ( 0 ) == 'c' );
CHECK ( ( char ) t2 ( 0, 0 ) == 'b' ); CHECK ( t2 ( 0, 0 ) == 'b' );
   
CHECK ( ( char ) t2 ( 1, 1 ) == 'b' ); CHECK ( t2 ( 1, 1 ) == 'b' );
t2 ( 1, 1 ) = 'c'; t2 ( 1, 1 ) = 'c';
CHECK ( ( char ) t2 ( 1, 1 ) == 'c' ); CHECK ( t2 ( 1, 1 ) == 'c' );
   
CHECK ( t2.checkStructure ( ) ); CHECK ( t2.checkStructure ( ) );
ext::tree < char >::const_prefix_iterator beg = t2.prefix_begin ( ); ext::tree < char >::const_prefix_iterator beg = t2.prefix_begin ( );
......
...@@ -66,12 +66,12 @@ TEST_CASE ( "Trie", "[unit][std][container]" ) { ...@@ -66,12 +66,12 @@ TEST_CASE ( "Trie", "[unit][std][container]" ) {
   
t2.getChildren().begin()->second.insert ( 'a', ext::trie < char, int > ( 5 ) ); t2.getChildren().begin()->second.insert ( 'a', ext::trie < char, int > ( 5 ) );
   
CHECK ( ( int ) t2 ( ) == 3 ); CHECK ( t2 ( ) == 3 );
CHECK ( ( int ) t2 ( 'a' ) == 1 ); CHECK ( t2 ( 'a' ) == 1 );
CHECK ( ( int ) t2 ( 'a', 'a' ) == 5 ); CHECK ( t2 ( 'a', 'a' ) == 5 );
   
t2 ( 'a', 'a' ) = 6; t2 ( 'a', 'a' ) = 6;
CHECK ( ( int ) t2 ( 'a', 'a' ) == 6 ); CHECK ( t2 ( 'a', 'a' ) == 6 );
   
CHECK ( t2.checkStructure ( ) ); CHECK ( t2.checkStructure ( ) );
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment