build: fix range-loop-analysis warnings
This commit is contained in:
parent
37899b3f8b
commit
8cdbbcb26e
@ -66,7 +66,7 @@ namespace cruft::iterator {
|
|||||||
zipped_iterator operator++ (int);
|
zipped_iterator operator++ (int);
|
||||||
|
|
||||||
|
|
||||||
auto
|
decltype(auto)
|
||||||
operator* (void)
|
operator* (void)
|
||||||
{
|
{
|
||||||
// We deliberately construct a tuple manually here to reduce
|
// We deliberately construct a tuple manually here to reduce
|
||||||
|
2
term.cpp
2
term.cpp
@ -91,7 +91,7 @@ cruft::term::has_csi_support (void)
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
graphics::graphics (layer _layer, hue _hue):
|
graphics::graphics (layer _layer, hue _hue):
|
||||||
m_value (_layer + _hue)
|
m_value (_layer + int (_hue))
|
||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,15 @@ int main ()
|
|||||||
{
|
{
|
||||||
cruft::TAP::logger tap;
|
cruft::TAP::logger tap;
|
||||||
|
|
||||||
tap.expect_nothrow ([] () { cruft::expected<std::string,int> { "foo" }; }, "value construction succeeds");
|
tap.expect_nothrow (
|
||||||
tap.expect_nothrow ([] () { cruft::expected<std::string,int> { EPERM }; }, "error construction succeeds");
|
[] () { (void)cruft::expected<std::string,int> { "foo" }; },
|
||||||
|
"value construction succeeds"
|
||||||
|
);
|
||||||
|
|
||||||
|
tap.expect_nothrow (
|
||||||
|
[] () { (void)cruft::expected<std::string,int> { EPERM }; },
|
||||||
|
"error construction succeeds"
|
||||||
|
);
|
||||||
|
|
||||||
tap.expect_eq (cruft::expected<std::string,int> { "foo" }.value (), "foo", "value matches");
|
tap.expect_eq (cruft::expected<std::string,int> { "foo" }.value (), "foo", "value matches");
|
||||||
tap.expect_eq (cruft::expected<std::string,int> { EPERM }.error (), EPERM, "error matches");
|
tap.expect_eq (cruft::expected<std::string,int> { EPERM }.error (), EPERM, "error matches");
|
||||||
|
@ -106,7 +106,7 @@ void test_bresenham (cruft::TAP::logger &tap)
|
|||||||
|
|
||||||
for (auto const &t: TESTS) {
|
for (auto const &t: TESTS) {
|
||||||
std::vector<cruft::point2i> computed;
|
std::vector<cruft::point2i> computed;
|
||||||
for (auto const &p: cruft::geom::bresenham ({ t.a, t.b }))
|
for (auto const p: cruft::geom::bresenham ({ t.a, t.b }))
|
||||||
computed.push_back (p);
|
computed.push_back (p);
|
||||||
tap.expect_eq (computed, t.expected, "bresenham: %!", t.message);
|
tap.expect_eq (computed, t.expected, "bresenham: %!", t.message);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ main (int, char**)
|
|||||||
char c_char[] = { '\0', 'b', 'c' };
|
char c_char[] = { '\0', 'b', 'c' };
|
||||||
|
|
||||||
bool success = true;
|
bool success = true;
|
||||||
for (auto const &[i, v, a, c]: cruft::iterator::izip (v_int, a_float, c_char)) {
|
for (auto const [i, v, a, c]: cruft::iterator::izip (v_int, a_float, c_char)) {
|
||||||
success = success &&
|
success = success &&
|
||||||
v_int[i] == v &&
|
v_int[i] == v &&
|
||||||
cruft::equal (a_float[i], a) &&
|
cruft::equal (a_float[i], a) &&
|
||||||
|
@ -25,7 +25,7 @@ test_transforms (cruft::TAP::logger &tap)
|
|||||||
{ "Don't.", "DON'T.", "don't.", "upper and lower and symbols" },
|
{ "Don't.", "DON'T.", "don't.", "upper and lower and symbols" },
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto const [src, upper, lower, msg]: TESTS) {
|
for (auto const &[src, upper, lower, msg]: TESTS) {
|
||||||
tap.expect_eq (cruft::to_upper (src), upper, "to_upper, %!", msg);
|
tap.expect_eq (cruft::to_upper (src), upper, "to_upper, %!", msg);
|
||||||
tap.expect_eq (cruft::to_lower (src), lower, "to_lower, %!", msg);
|
tap.expect_eq (cruft::to_lower (src), lower, "to_lower, %!", msg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user