From aa1932643331ff0abf9de93ab088578d6f9f2461 Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:05:12 +0100 Subject: [PATCH] fix some compiler warning (#2034) * fix compiler warnings * fix some more warnings --- test/unit/test_lif_cell_group.cpp | 4 ++-- test/unit/test_segment_tree.cpp | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/unit/test_lif_cell_group.cpp b/test/unit/test_lif_cell_group.cpp index b2241b2f..93718e9f 100644 --- a/test/unit/test_lif_cell_group.cpp +++ b/test/unit/test_lif_cell_group.cpp @@ -258,7 +258,7 @@ TEST(lif_cell_group, probe) { auto fun = [&ums](probe_metadata pm, std::size_t n, const sample_record* samples) { - for (int ix = 0; ix < n; ++ix) { + for (std::size_t ix = 0; ix < n; ++ix) { const auto& [t, v] = samples[ix]; double u = *util::any_cast<double*>(v); ums[pm.id].push_back({t, u}); @@ -684,7 +684,7 @@ std::vector<Um_type> exp = {{ 0, -18 }, ASSERT_FALSE(testing::seq_eq(ums[{1, 0}], exp)); // now check the spikes std::sort(spikes.begin(), spikes.end()); - EXPECT_EQ(spikes.size(), 3); + EXPECT_EQ(spikes.size(), 3u); std::vector<double> sexp{2, 4, 5}; ASSERT_TRUE(testing::seq_almost_eq<double>(spikes, sexp)); } diff --git a/test/unit/test_segment_tree.cpp b/test/unit/test_segment_tree.cpp index f7c16b6d..571f332f 100644 --- a/test/unit/test_segment_tree.cpp +++ b/test/unit/test_segment_tree.cpp @@ -353,12 +353,13 @@ TEST(segment_tree, tag_roots) { EXPECT_EQ((std::vector<arb::msize_t>{3}), arb::tag_roots(tree, 3)); } } - // gnarly tree - // (npos) - 0 - 1 - 4 - // \ - // 2 - 3 - // \ - // 5 + /* gnarly tree + ** (npos) - 0 - 1 - 4 + ** \ + ** 2 - 3 + ** \ + ** 5 + */ { arb::segment_tree tree; tree.append(arb::mnpos, {0, 0, 0}, {0, 0, 1}, 1); // 0 -- GitLab