From 01630588fc97d2991ce58415e1e875e9dadb7848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tr=C3=A1vn=C3=AD=C4=8Dek?= <travnja3@fit.cvut.cz> Date: Sun, 14 Mar 2021 08:49:16 +0100 Subject: [PATCH] std: remove not needed casts in tests --- .../test-src/extensions/container/ForwardTreeTest.cpp | 4 ++-- .../test-src/extensions/container/LinearSetTest.cpp | 4 ++-- alib2std/test-src/extensions/container/SetTest.cpp | 4 ++-- alib2std/test-src/extensions/container/TreeTest.cpp | 10 +++++----- alib2std/test-src/extensions/container/TrieTest.cpp | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/alib2std/test-src/extensions/container/ForwardTreeTest.cpp b/alib2std/test-src/extensions/container/ForwardTreeTest.cpp index ef51be6fc7..9d936d64b1 100644 --- a/alib2std/test-src/extensions/container/ForwardTreeTest.cpp +++ b/alib2std/test-src/extensions/container/ForwardTreeTest.cpp @@ -54,9 +54,9 @@ TEST_CASE ( "Forward Tree", "[unit][std][container]" ) { print_tree ( t2, ""); - CHECK( ( char ) t2 ( 1, 1 ) == 'b' ); + CHECK( t2 ( 1, 1 ) == 'b' ); 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 ( ); beg++; diff --git a/alib2std/test-src/extensions/container/LinearSetTest.cpp b/alib2std/test-src/extensions/container/LinearSetTest.cpp index 13015b9e51..476a1d6cad 100644 --- a/alib2std/test-src/extensions/container/LinearSetTest.cpp +++ b/alib2std/test-src/extensions/container/LinearSetTest.cpp @@ -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 (second.begin(), second.end(), first.begin(), first.end(), std::inserter(secondMinusFirst, secondMinusFirst.end())); - CHECK(firstMinusSecond.size() == (size_t) 0u); - CHECK(secondMinusFirst.size() == (size_t) 2u); + CHECK(firstMinusSecond.size() == 0u); + CHECK(secondMinusFirst.size() == 2u); } SECTION ( "Test3" ) { diff --git a/alib2std/test-src/extensions/container/SetTest.cpp b/alib2std/test-src/extensions/container/SetTest.cpp index 255cfc77fc..c629078ea7 100644 --- a/alib2std/test-src/extensions/container/SetTest.cpp +++ b/alib2std/test-src/extensions/container/SetTest.cpp @@ -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 (second.begin(), second.end(), first.begin(), first.end(), std::inserter(secondMinusFirst, secondMinusFirst.end())); - CHECK(firstMinusSecond.size() == (size_t) 0u); - CHECK(secondMinusFirst.size() == (size_t) 2u); + CHECK(firstMinusSecond.size() == 0u); + CHECK(secondMinusFirst.size() == 2u); } } diff --git a/alib2std/test-src/extensions/container/TreeTest.cpp b/alib2std/test-src/extensions/container/TreeTest.cpp index 4975de30dd..9b7c29c98c 100644 --- a/alib2std/test-src/extensions/container/TreeTest.cpp +++ b/alib2std/test-src/extensions/container/TreeTest.cpp @@ -64,13 +64,13 @@ TEST_CASE ( "Tree", "[unit][std][container]" ) { print_tree ( t2, "" ); - CHECK ( ( char ) t2 ( ) == 'c' ); - CHECK ( ( char ) t2 ( 0 ) == 'c' ); - CHECK ( ( char ) t2 ( 0, 0 ) == 'b' ); + CHECK ( t2 ( ) == 'c' ); + CHECK ( t2 ( 0 ) == 'c' ); + CHECK ( t2 ( 0, 0 ) == 'b' ); - CHECK ( ( char ) t2 ( 1, 1 ) == 'b' ); + CHECK ( t2 ( 1, 1 ) == 'b' ); t2 ( 1, 1 ) = 'c'; - CHECK ( ( char ) t2 ( 1, 1 ) == 'c' ); + CHECK ( t2 ( 1, 1 ) == 'c' ); CHECK ( t2.checkStructure ( ) ); ext::tree < char >::const_prefix_iterator beg = t2.prefix_begin ( ); diff --git a/alib2std/test-src/extensions/container/TrieTest.cpp b/alib2std/test-src/extensions/container/TrieTest.cpp index 60040033db..3e044014b0 100644 --- a/alib2std/test-src/extensions/container/TrieTest.cpp +++ b/alib2std/test-src/extensions/container/TrieTest.cpp @@ -66,12 +66,12 @@ TEST_CASE ( "Trie", "[unit][std][container]" ) { t2.getChildren().begin()->second.insert ( 'a', ext::trie < char, int > ( 5 ) ); - CHECK ( ( int ) t2 ( ) == 3 ); - CHECK ( ( int ) t2 ( 'a' ) == 1 ); - CHECK ( ( int ) t2 ( 'a', 'a' ) == 5 ); + CHECK ( t2 ( ) == 3 ); + CHECK ( t2 ( 'a' ) == 1 ); + CHECK ( t2 ( 'a', 'a' ) == 5 ); t2 ( 'a', 'a' ) = 6; - CHECK ( ( int ) t2 ( 'a', 'a' ) == 6 ); + CHECK ( t2 ( 'a', 'a' ) == 6 ); CHECK ( t2.checkStructure ( ) ); -- GitLab