summaryrefslogtreecommitdiff
path: root/gentoobrowse-api/unittests
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-19 21:05:22 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-19 21:05:22 +0000
commit59ac197145142196b3a90295b7ab1ea5de523ff8 (patch)
tree94bfc9819205b26c9f4bab06210c36d298f7eb5e /gentoobrowse-api/unittests
parentAdd support for unpacking PostgreSQL text arrays from their string form (diff)
downloadgentoobrowse-api-59ac197145142196b3a90295b7ab1ea5de523ff8.tar.bz2
gentoobrowse-api-59ac197145142196b3a90295b7ab1ea5de523ff8.tar.xz
gentoobrowse-api-59ac197145142196b3a90295b7ab1ea5de523ff8.zip
Add support for getting a news item by Id
Diffstat (limited to 'gentoobrowse-api/unittests')
-rw-r--r--gentoobrowse-api/unittests/testPortage.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/gentoobrowse-api/unittests/testPortage.cpp b/gentoobrowse-api/unittests/testPortage.cpp
index 063b6a4..8a8d5bb 100644
--- a/gentoobrowse-api/unittests/testPortage.cpp
+++ b/gentoobrowse-api/unittests/testPortage.cpp
@@ -240,6 +240,34 @@ BOOST_AUTO_TEST_CASE( getBugsSearch )
BOOST_REQUIRE_EQUAL(567682, bs[2]->bugid);
}
+BOOST_AUTO_TEST_CASE( getNewsItem )
+{
+ MockPool mp;
+ auto p = Portage::PointerType(new Portage(mp));
+ auto n = p->getNewsItem("2015-02-01-use-libav");
+ BOOST_REQUIRE(n);
+ BOOST_REQUIRE_EQUAL("2015-02-01-use-libav", n->newsid);
+ BOOST_REQUIRE_EQUAL("ffmpeg/libav conflict management: USE=libav", n->title);
+ BOOST_REQUIRE_EQUAL("2015-02-01T00:00:00", n->posted);
+ BOOST_REQUIRE(n->authorname);
+ BOOST_REQUIRE_EQUAL("Michał Górny", *n->authorname);
+ BOOST_REQUIRE(n->authoremail);
+ BOOST_REQUIRE_EQUAL("mgorny@gentoo.org", *n->authoremail);
+ BOOST_REQUIRE_EQUAL(2, n->atomspec.size());
+ BOOST_REQUIRE_EQUAL("media-video/ffmpeg", n->atomspec.front());
+ BOOST_REQUIRE_EQUAL("media-video/libav", n->atomspec.back());
+ BOOST_REQUIRE_EQUAL(5, n->body.size());
+ BOOST_REQUIRE_EQUAL("The support for automatic choice between ffmpeg and libav is going to be deprecated in favor of explicit choice via USE flags. This change aims to solve multiple repeating issues, including Portage undesirably wanting to replace one package with the other, lack of proper reverse dependency on ffmpeg/libav upgrades and some of the hard-to-understand upgrade failures involving blockers. It also may be used to make ffmpeg and libav co-installable in the future.", n->body.front());
+ BOOST_REQUIRE_EQUAL("Please do not alter the state of 'libav' flag on a per-package basis (e.g. via package.use). The flag needs to be set globally to have consistent value throughout all packages. Otherwise, blockers will prevent upgrades.", n->body.back());
+ BOOST_REQUIRE_EQUAL(0, n->urls.size());
+
+ auto n2 = p->getNewsItem("2014-10-26-gcc_4_7_introduced_new_c++11_abi");
+ BOOST_REQUIRE(n2);
+ BOOST_REQUIRE_EQUAL("2014-10-26-gcc_4_7_introduced_new_c++11_abi", n2->newsid);
+ BOOST_REQUIRE_EQUAL(1, n2->urls.size());
+ BOOST_REQUIRE_EQUAL("http://ispras.linuxbase.org/index.php/ABI_compliance_checker", n2->urls.front());
+}
+
BOOST_AUTO_TEST_CASE( cache )
{
MockPool mp;