lib: hide some code from coverage checking

Parts that are not easy / useful to unit-test
This commit is contained in:
Dirk-Jan C. Binnema 2023-09-10 10:12:07 +03:00
parent 85ad35bd8e
commit 192c67262a
4 changed files with 16 additions and 2 deletions

View File

@ -109,6 +109,7 @@ QueryMatch::has_flag(QueryMatch::Flags flag) const
return any_of(flags & flag);
}
/* LCOV_EXCL_START */
static inline std::ostream&
operator<<(std::ostream& os, QueryMatch::Flags mflags)
{
@ -140,8 +141,6 @@ operator<<(std::ostream& os, QueryMatch::Flags mflags)
return os;
}
using QueryMatches = std::unordered_map<Xapian::docid, QueryMatch>;
inline std::ostream&
operator<<(std::ostream& os, const QueryMatch& qmatch)
{
@ -151,6 +150,10 @@ operator<<(std::ostream& os, const QueryMatch& qmatch)
return os;
}
/* LCOV_EXCL_STOP*/
using QueryMatches = std::unordered_map<Xapian::docid, QueryMatch>;
///
/// This is a view over the Xapian::MSet, which can optionally filter unreadable

View File

@ -107,6 +107,7 @@ struct Container {
using Containers = Container::Containers;
using ContainerVec = Container::ContainerVec;
/* LCOV_EXCL_START */
static std::ostream&
operator<<(std::ostream& os, const Container& container)
{
@ -125,6 +126,7 @@ operator<<(std::ostream& os, const Container& container)
return os;
}
/* LCOV_EXCL_STOP */
using IdTable = std::unordered_map<std::string, Container>;
using DupTable = std::multimap<std::string, Container>;
@ -534,6 +536,7 @@ sort_siblings(IdTable& id_table, bool descending)
update_containers(root_vec, descending, id_table.size());
}
/* LCOV_EXCL_START */
static std::ostream&
operator<<(std::ostream& os, const IdTable& id_table)
{
@ -559,6 +562,7 @@ operator<<(std::ostream& os, const IdTable& id_table)
}
return os;
}
/* LCOV_EXCL_STOP */
template <typename Results>
static void

View File

@ -50,6 +50,8 @@
using namespace Mu;
/* LCOV_EXCL_START */
/// output stream to _either_ a file or to a stringstream
struct OutputStream {
/**
@ -1160,3 +1162,5 @@ Server::invoke(const std::string& expr) noexcept
{
return priv_->invoke(expr);
}
/* LCOV_EXCL_STOP */

View File

@ -27,6 +27,8 @@
#include <utils/mu-utils.hh>
#include <mu-store.hh>
/* LCOV_EXCL_START */
namespace Mu {
/**
@ -82,5 +84,6 @@ MU_ENABLE_BITOPS(Server::OutputFlags);
} // namespace Mu
/* LCOV_EXCL_STOP */
#endif /* MU_SERVER_HH__ */