diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-12-17 18:29:32 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-12-27 17:16:13 +0000 |
commit | 42f649adfeb3d0ed96c68bc14e84dcf06a5048e9 (patch) | |
tree | 0261636e60da47ccd4c453e1326578c0029ac86c | |
parent | Add method for getting recent versions for user tracked packages (diff) | |
download | gentoobrowse-api-42f649adfeb3d0ed96c68bc14e84dcf06a5048e9.tar.bz2 gentoobrowse-api-42f649adfeb3d0ed96c68bc14e84dcf06a5048e9.tar.xz gentoobrowse-api-42f649adfeb3d0ed96c68bc14e84dcf06a5048e9.zip |
Fix ordering and test case
-rw-r--r-- | gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql | 2 | ||||
-rw-r--r-- | gentoobrowse-api/unittests/testPortage.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql b/gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql index 1f59500..6b9a5a1 100644 --- a/gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql +++ b/gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql @@ -2,5 +2,5 @@ SELECT e.ebuildid, e.packageid, e.repoid, e.version, e.slot, e.firstseen, e.modd FROM gentoobrowse.user_packages up, gentoobrowse.ebuilds e WHERE up.userid = ? AND up.packageid = e.packageid -ORDER BY e.firstseen +ORDER BY e.firstseen DESC LIMIT ? diff --git a/gentoobrowse-api/unittests/testPortage.cpp b/gentoobrowse-api/unittests/testPortage.cpp index fdfd1f9..588ad8c 100644 --- a/gentoobrowse-api/unittests/testPortage.cpp +++ b/gentoobrowse-api/unittests/testPortage.cpp @@ -277,8 +277,10 @@ BOOST_AUTO_TEST_CASE( getUserTrackedRecentVersions ) { auto ps = p->getUserTrackedRecentVersions(1, 4); BOOST_REQUIRE_EQUAL(4, ps.size()); - BOOST_REQUIRE_EQUAL(55943, ps.front()->packageid); + BOOST_REQUIRE_EQUAL(49517, ps.front()->packageid); + BOOST_REQUIRE_EQUAL("2015-12-02T19:12:42.627493", ps.front()->firstseen); BOOST_REQUIRE_EQUAL(54144, ps.back()->packageid); + BOOST_REQUIRE_EQUAL("2015-10-17T15:00:13.238126", ps.back()->firstseen); } BOOST_AUTO_TEST_CASE( getPackageRuntimeDependencies ) |