[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [libechonest] tests: Add test for new API
From: Leo Franchi <lfranchi () kde ! org>
Date: 2013-05-19 2:28:29
Message-ID: 20130519022829.372C4A6075 () git ! kde ! org
[Download RAW message or body]
Git commit 1968dc9d478392689d17cf8ab5b6186fe7cd8b62 by Leo Franchi.
Committed on 19/05/2013 at 04:27.
Pushed by lfranchi into branch 'master'.
Add test for new API
M +21 -0 tests/SongTest.cpp
http://commits.kde.org/libechonest/1968dc9d478392689d17cf8ab5b6186fe7cd8b62
diff --git a/tests/SongTest.cpp b/tests/SongTest.cpp
index 2245cfb..d2454e8 100644
--- a/tests/SongTest.cpp
+++ b/tests/SongTest.cpp
@@ -99,6 +99,27 @@ void SongTest::testSearch1()
}
+void SongTest::testSearch2()
+{
+ Echonest::Song::SearchParams params;
+ params.append( Echonest::Song::SearchParamData( Echonest::Song::Description, \
QLatin1String("emo") ) ); + params.append( Echonest::Song::SearchParamData( \
Echonest::Song::ArtistStartYearAfter, 1990 ) ); + params.append( \
Echonest::Song::SearchParamData( Echonest::Song::ArtistStartYearBefore, 2000 ) ); + \
params.append( Echonest::Song::SearchParamData( Echonest::Song::Results, 2 ) ); +
+ QNetworkReply* reply = Echonest::Song::search( params, \
Echonest::SongInformation( Echonest::SongInformation::ArtistHotttnesss | + \
Echonest::SongInformation::ArtistLocation | + \
Echonest::SongInformation::ArtistFamiliarity ) ); + qDebug() << "Test search:" << \
reply->url().toString(); + QEventLoop loop;
+ loop.connect( reply, SIGNAL(finished()), SLOT(quit()) );
+ loop.exec();
+
+ QVector< Echonest::Song > songs = Echonest::Song::parseSearch( reply );
+ qDebug() << songs << songs.size();
+ QVERIFY( !songs.isEmpty() );
+}
+
void SongTest::testProfile()
{
Echonest::Song song;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic