Commit 8a2649a2 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Add test for new overload - WIP

parent 6aeaf3a7
......@@ -67,4 +67,32 @@ TEST ( ReplacementFilter, filterReplace3 )
CReplacementFilter::filterReplace ( list );
EXPECT_EQ ( 3, list.size ( ) );
}
TEST ( ReplacementFilter, filterReplace4 )
{
std::list<std::unique_ptr<CUpdateScene>> list;
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
list.push_back ( std::make_unique<CUpdateScene> ( 1 ) );
auto lastUpdate = std::make_unique<CUpdateScene> ( 1 );
auto rawLastUpdate = lastUpdate.get ( );
list.push_back ( std::move ( lastUpdate ) );
CReplacementFilter::filterReplace ( list );
EXPECT_EQ ( 1, list.size ( ) );
auto afterReplace = list.front ( ).release ( );
auto ptr1 = dynamic_cast< CUpdateScene* >( rawLastUpdate );
auto ptr2 = dynamic_cast< CUpdateScene* >( afterReplace );
EXPECT_EQ ( *ptr1, *ptr2 );
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment