diff options
Diffstat (limited to 'gentoobrowse-api/unittests/testMasks.cpp')
-rw-r--r-- | gentoobrowse-api/unittests/testMasks.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/gentoobrowse-api/unittests/testMasks.cpp b/gentoobrowse-api/unittests/testMasks.cpp index 3fc40e9..7f37d3b 100644 --- a/gentoobrowse-api/unittests/testMasks.cpp +++ b/gentoobrowse-api/unittests/testMasks.cpp @@ -1,38 +1,40 @@ #define BOOST_TEST_MODULE Masks #include <boost/test/unit_test.hpp> -#include <mask.h> -#include <fileUtils.h> +#include <boost/algorithm/string/join.hpp> +#include <compileTimeFormatter.h> #include <definedDirs.h> +#include <fileUtils.h> +#include <mask.h> #include <portage-models.h> -#include <compileTimeFormatter.h> -#include <boost/algorithm/string/join.hpp> class MaskTester : public Portage::Utils::Masks { - protected: - void consume() const override - { - if (email && person) { - masks.push_back(std::make_shared<Gentoo::Mask>(n, person->raw(), email->raw(), date, - boost::algorithm::join(message, " "), - Gentoo::StringList(atoms.begin(), atoms.end()))); - } +protected: + void + consume() const override + { + if (email && person) { + masks.push_back(std::make_shared<Gentoo::Mask>(n, person->raw(), email->raw(), date, + boost::algorithm::join(message, " "), Gentoo::StringList(atoms.begin(), atoms.end()))); } + } - public: - mutable Gentoo::Masks masks; +public: + mutable Gentoo::Masks masks; }; -#define BOOST_CHECK_EQUAL_COLLECTION(a, ...) { \ - auto __list__ = { __VA_ARGS__ }; \ - BOOST_CHECK_EQUAL_COLLECTIONS(a.begin(), a.end(), __list__.begin(), __list__.end()); \ -} +#define BOOST_CHECK_EQUAL_COLLECTION(a, ...) \ + { \ + auto __list__ = {__VA_ARGS__}; \ + BOOST_CHECK_EQUAL_COLLECTIONS(a.begin(), a.end(), __list__.begin(), __list__.end()); \ + } BOOST_FIXTURE_TEST_SUITE(mt, MaskTester) BOOST_AUTO_TEST_CASE(f1) { - AdHoc::FileUtils::MemMap f(rootDir / "fixtures" / "4156eb45cf3b0ce1d7125b84efd8688c2d6e831d" / "profiles" / "package.mask"); + AdHoc::FileUtils::MemMap f( + rootDir / "fixtures" / "4156eb45cf3b0ce1d7125b84efd8688c2d6e831d" / "profiles" / "package.mask"); extract((const gchar *)f.data, f.getStat().st_size); BOOST_CHECK_EQUAL(masks.size(), 151); auto m = masks.front(); @@ -42,10 +44,8 @@ BOOST_AUTO_TEST_CASE(f1) BOOST_CHECK_EQUAL("chewi@gentoo.org", *m->email); BOOST_CHECK_EQUAL("1016-04-25", m->dateadded); BOOST_CHECK_EQUAL("Long dead upstream and no longer needed. Removal in 30 days.", m->message); - BOOST_CHECK_EQUAL_COLLECTION(m->atomspec, - "dev-java/charva", - "dev-java/jakarta-slide-webdavclient", - "dev-java/xml-im-exporter"); + BOOST_CHECK_EQUAL_COLLECTION( + m->atomspec, "dev-java/charva", "dev-java/jakarta-slide-webdavclient", "dev-java/xml-im-exporter"); } BOOST_AUTO_TEST_CASE(whitespaceline) @@ -75,4 +75,3 @@ dev-python/py2-ipaddress } BOOST_AUTO_TEST_SUITE_END() - |