mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-18 20:40:43 +01:00
Fix a couple of tests
This commit is contained in:
parent
cb275f318f
commit
3ba97ead0b
@ -68,12 +68,12 @@ TEST_F(LibraryBackendTest, EmptyDatabase) {
|
||||
TEST_F(LibraryBackendTest, AddDirectory) {
|
||||
QSignalSpy spy(backend_.get(), SIGNAL(DirectoryDiscovered(Directory, SubdirectoryList)));
|
||||
|
||||
backend_->AddDirectory("/test");
|
||||
backend_->AddDirectory("/tmp");
|
||||
|
||||
// Check the signal was emitted correctly
|
||||
ASSERT_EQ(1, spy.count());
|
||||
Directory dir = spy[0][0].value<Directory>();
|
||||
EXPECT_EQ("/test", dir.path);
|
||||
EXPECT_EQ("/tmp", dir.path);
|
||||
EXPECT_EQ(1, dir.id);
|
||||
EXPECT_EQ(0, spy[0][1].value<SubdirectoryList>().size());
|
||||
}
|
||||
@ -82,7 +82,7 @@ TEST_F(LibraryBackendTest, RemoveDirectory) {
|
||||
// Add a directory
|
||||
Directory dir;
|
||||
dir.id = 1;
|
||||
dir.path = "/test";
|
||||
dir.path = "/tmp";
|
||||
backend_->AddDirectory(dir.path);
|
||||
|
||||
QSignalSpy spy(backend_.get(), SIGNAL(DirectoryDeleted(Directory)));
|
||||
@ -93,13 +93,13 @@ TEST_F(LibraryBackendTest, RemoveDirectory) {
|
||||
// Check the signal was emitted correctly
|
||||
ASSERT_EQ(1, spy.count());
|
||||
dir = spy[0][0].value<Directory>();
|
||||
EXPECT_EQ("/test", dir.path);
|
||||
EXPECT_EQ("/tmp", dir.path);
|
||||
EXPECT_EQ(1, dir.id);
|
||||
}
|
||||
|
||||
TEST_F(LibraryBackendTest, AddInvalidSong) {
|
||||
// Adding a song without certain fields set should fail
|
||||
backend_->AddDirectory("/test");
|
||||
backend_->AddDirectory("/tmp");
|
||||
Song s;
|
||||
s.set_directory_id(1);
|
||||
|
||||
@ -136,7 +136,7 @@ class SingleSong : public LibraryBackendTest {
|
||||
LibraryBackendTest::SetUp();
|
||||
|
||||
// Add a directory - this will get ID 1
|
||||
backend_->AddDirectory("/test");
|
||||
backend_->AddDirectory("/tmp");
|
||||
|
||||
// Make a song in that directory
|
||||
song_ = MakeDummySong(1);
|
||||
|
@ -52,11 +52,11 @@ class LibraryModelTest : public ::testing::Test {
|
||||
song.set_directory_id(1);
|
||||
if (song.mtime() == -1) song.set_mtime(1);
|
||||
if (song.ctime() == -1) song.set_ctime(1);
|
||||
if (song.filename().isNull()) song.set_filename("/test/foo");
|
||||
if (song.filename().isNull()) song.set_filename("/tmp/foo");
|
||||
if (song.filesize() == -1) song.set_filesize(1);
|
||||
|
||||
if (!added_dir_) {
|
||||
backend_->AddDirectory("/test");
|
||||
backend_->AddDirectory("/tmp");
|
||||
added_dir_ = true;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
|
||||
MOCK_METHOD0(ReloadSettings, void());
|
||||
|
||||
MOCK_METHOD3(PlayAt, void(int, Engine::TrackChangeType, bool));
|
||||
MOCK_METHOD3(PlayAt, void(int, Engine::TrackChangeFlags, bool));
|
||||
MOCK_METHOD0(PlayPause, void());
|
||||
|
||||
MOCK_METHOD0(Next, void());
|
||||
|
Loading…
Reference in New Issue
Block a user