Commit f3a9f056 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

tests: samples: Check for release year when available

parent 4ce0338b
......@@ -160,6 +160,12 @@ void Tests::checkAlbums(const rapidjson::Value& expectedAlbums )
return false;
}
}
if ( expectedAlbum.HasMember( "releaseYear" ) )
{
const auto releaseYear = expectedAlbum["releaseYear"].GetUint();
if ( a->releaseYear() != releaseYear )
return false;
}
return true;
});
ASSERT_NE( end( albums ), it );
......@@ -196,7 +202,12 @@ void Tests::checkAlbumTracks( const IAlbum* album, const std::vector<MediaPtr>&
if ( expectedTrack.HasMember( "genre" ) )
{
if ( strcasecmp( expectedTrack["genre"].GetString(), albumTrack->genre().c_str() ) != 0 )
return ;
return ;
}
if ( expectedTrack.HasMember( "releaseYear" ) )
{
if ( albumTrack->releaseYear() != expectedTrack["releaseYear"].GetUint() )
return;
}
// Always check if the album link is correct. This isn't part of finding the proper album, so just fail hard
// if the check fails.
......
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