summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-12-17 18:29:32 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2016-12-27 17:16:13 +0000
commitc0b95cfda592e15dea0f3dd3d12bbdf3a2a53f8c (patch)
tree0261636e60da47ccd4c453e1326578c0029ac86c
parentAdd method for getting recent versions for user tracked packages (diff)
downloadgentoobrowse-api-c0b95cfda592e15dea0f3dd3d12bbdf3a2a53f8c.tar.bz2
gentoobrowse-api-c0b95cfda592e15dea0f3dd3d12bbdf3a2a53f8c.tar.xz
gentoobrowse-api-c0b95cfda592e15dea0f3dd3d12bbdf3a2a53f8c.zip
Fix ordering and test case
-rw-r--r--gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql2
-rw-r--r--gentoobrowse-api/unittests/testPortage.cpp4
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 )