diff options
author | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2016-11-18 15:08:52 +0000 |
---|---|---|
committer | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2016-11-18 15:08:52 +0000 |
commit | 8135220aea07459c6d6d5dabe143fc6004e28c54 (patch) | |
tree | 5c0eb03b1eb31cfbe03dbdac388442acc7883b84 | |
parent | Add support for getting packaged details tracked by a user (diff) | |
download | gentoobrowse-api-8135220aea07459c6d6d5dabe143fc6004e28c54.tar.bz2 gentoobrowse-api-8135220aea07459c6d6d5dabe143fc6004e28c54.tar.xz gentoobrowse-api-8135220aea07459c6d6d5dabe143fc6004e28c54.zip |
Fix use flag ordering to be not locale sensitive and resulting changes in test case
-rw-r--r-- | gentoobrowse-api/service/sql/portage/getPackageUses.sql | 2 | ||||
-rw-r--r-- | gentoobrowse-api/unittests/testPortage.cpp | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/gentoobrowse-api/service/sql/portage/getPackageUses.sql b/gentoobrowse-api/service/sql/portage/getPackageUses.sql index 5e74e35..0b06b20 100644 --- a/gentoobrowse-api/service/sql/portage/getPackageUses.sql +++ b/gentoobrowse-api/service/sql/portage/getPackageUses.sql @@ -15,4 +15,4 @@ FROM gentoobrowse.ebuilds e AND eu.use = ugs.name || '_' || ugg.use WHERE e.packageid = ? GROUP BY eu.use, ul.use, ul.packageid, ug.use, ugs.name, ugg.usegroupid, ugg.use, ugg.description -ORDER BY ugs.name nulls first, eu.use +ORDER BY ugs.name nulls first, LTRIM(COALESCE(ugg.use, eu.use), '+') diff --git a/gentoobrowse-api/unittests/testPortage.cpp b/gentoobrowse-api/unittests/testPortage.cpp index afb41e4..ae6224d 100644 --- a/gentoobrowse-api/unittests/testPortage.cpp +++ b/gentoobrowse-api/unittests/testPortage.cpp @@ -310,15 +310,18 @@ BOOST_AUTO_TEST_CASE( getPackageUses ) { auto us = p->getPackageUses(46436); BOOST_REQUIRE_EQUAL(19, us.size()); - BOOST_REQUIRE_EQUAL("keyutils", us.front()->use); - BOOST_REQUIRE(us.front()->isdefault); + BOOST_REQUIRE_EQUAL("doc", us.front()->use); + BOOST_REQUIRE(!us[0]->isdefault); + BOOST_REQUIRE(us[1]->isdefault); BOOST_REQUIRE(us.front()->packageid); BOOST_REQUIRE_EQUAL(46436, us.front()->packageid); BOOST_REQUIRE(!us[0]->group); BOOST_REQUIRE(us[9]->group); BOOST_REQUIRE_EQUAL("abi_mips", *us[9]->group); - BOOST_REQUIRE_EQUAL("Enable for the keyring ccache using keyutils.", us[0]->description); - BOOST_REQUIRE_EQUAL("selinux", us[6]->use); + BOOST_REQUIRE_EQUAL("Enable for the keyring ccache using keyutils.", us[1]->description); + BOOST_REQUIRE_EQUAL("selinux", us[5]->use); + BOOST_REQUIRE_EQUAL("test", us[6]->use); + BOOST_REQUIRE_EQUAL("threads", us[7]->use); BOOST_REQUIRE(!us[2]->packageid); } |