Use the global QApplication now
This commit is contained in:
parent
4ab755c831
commit
dfc972be63
|
@ -11,19 +11,12 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
static int argc = 1;
|
|
||||||
static const char* argv[] = { "test", 0 };
|
|
||||||
|
|
||||||
class AlbumCoverFetcherTest : public ::testing::Test {
|
class AlbumCoverFetcherTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
static void SetUpTestCase() {
|
static void SetUpTestCase() {
|
||||||
lastfm::ws::ApiKey = "foobar";
|
lastfm::ws::ApiKey = "foobar";
|
||||||
}
|
}
|
||||||
|
|
||||||
AlbumCoverFetcherTest()
|
|
||||||
: app_(argc, (char**)argv) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetUp() {
|
void SetUp() {
|
||||||
// Lastfm takes ownership of this.
|
// Lastfm takes ownership of this.
|
||||||
network_ = new MockNetworkAccessManager;
|
network_ = new MockNetworkAccessManager;
|
||||||
|
@ -31,7 +24,6 @@ class AlbumCoverFetcherTest : public ::testing::Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
MockNetworkAccessManager* network_;
|
MockNetworkAccessManager* network_;
|
||||||
QCoreApplication app_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,10 +46,10 @@ TEST_F(AlbumCoverFetcherTest, FetchesAlbumCover) {
|
||||||
fetcher.FetchAlbumCover("Foo", "Bar");
|
fetcher.FetchAlbumCover("Foo", "Bar");
|
||||||
|
|
||||||
get_info_reply->Done();
|
get_info_reply->Done();
|
||||||
app_.processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
album_reply->Done();
|
album_reply->Done();
|
||||||
app_.processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
EXPECT_EQ(1, spy.count());
|
EXPECT_EQ(1, spy.count());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue