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

Tests: Do not hardcode path to samples

parent 60cbf80b
...@@ -52,3 +52,6 @@ target_link_libraries(unittest gtest gtest_main) ...@@ -52,3 +52,6 @@ target_link_libraries(unittest gtest gtest_main)
if(UNIX) if(UNIX)
target_link_libraries(unittest "pthread") target_link_libraries(unittest "pthread")
endif() endif()
## Download files for parsing unit tests
file(DOWNLOAD "http://streams.videolan.org/streams/mp3/05-Mr.%20Zebra.mp3" "${CMAKE_CURRENT_BINARY_DIR}/mr-zebra.mp3")
...@@ -67,12 +67,12 @@ libvlc_instance_t* VLCMetadataServices::vlcInstance; ...@@ -67,12 +67,12 @@ libvlc_instance_t* VLCMetadataServices::vlcInstance;
TEST_F( VLCMetadataServices, ParseAudio ) TEST_F( VLCMetadataServices, ParseAudio )
{ {
std::unique_lock<std::mutex> lock( cb->mutex ); std::unique_lock<std::mutex> lock( cb->mutex );
auto file = ml->addFile( "/home/chouquette/samples/mr-zebra.mp3" ); auto file = ml->addFile( "mr-zebra.mp3" );
std::vector<AudioTrackPtr> tracks; std::vector<AudioTrackPtr> tracks;
cb->waitCond.wait( lock, [&]{ return file->audioTracks( tracks ) == true && tracks.size() > 0; } ); cb->waitCond.wait( lock, [&]{ return file->audioTracks( tracks ) == true && tracks.size() > 0; } );
SetUp(); SetUp();
file = ml->file( "/home/chouquette/samples/mr-zebra.mp3" ); file = ml->file( "mr-zebra.mp3" );
bool res = file->audioTracks( tracks ); bool res = file->audioTracks( tracks );
ASSERT_TRUE( res ); ASSERT_TRUE( res );
ASSERT_EQ( tracks.size(), 1u ); ASSERT_EQ( tracks.size(), 1u );
......
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