From c0b95cfda592e15dea0f3dd3d12bbdf3a2a53f8c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 17 Dec 2016 18:29:32 +0000 Subject: Fix ordering and test case --- gentoobrowse-api/service/sql/portage/getUserTrackedRecentVersions.sql | 2 +- 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 ) -- cgit v1.2.3