Use the global QApplication now

This commit is contained in:
David Sansome 2010-03-23 21:44:43 +00:00
parent 4ab755c831
commit dfc972be63
1 changed files with 2 additions and 10 deletions

View File

@ -11,19 +11,12 @@
namespace {
static int argc = 1;
static const char* argv[] = { "test", 0 };
class AlbumCoverFetcherTest : public ::testing::Test {
protected:
static void SetUpTestCase() {
lastfm::ws::ApiKey = "foobar";
}
AlbumCoverFetcherTest()
: app_(argc, (char**)argv) {
}
void SetUp() {
// Lastfm takes ownership of this.
network_ = new MockNetworkAccessManager;
@ -31,7 +24,6 @@ class AlbumCoverFetcherTest : public ::testing::Test {
}
MockNetworkAccessManager* network_;
QCoreApplication app_;
};
@ -54,10 +46,10 @@ TEST_F(AlbumCoverFetcherTest, FetchesAlbumCover) {
fetcher.FetchAlbumCover("Foo", "Bar");
get_info_reply->Done();
app_.processEvents(QEventLoop::ExcludeUserInputEvents);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
album_reply->Done();
app_.processEvents(QEventLoop::ExcludeUserInputEvents);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
EXPECT_EQ(1, spy.count());
}