Skip to content

Commit 1bb32c0

Browse files
committed
#381: ASSERT_CLUSTER_NOISE_SIZES correction and additional checking for CLIQUE's blocks.
1 parent daa7482 commit 1bb32c0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ccore/tst/utenv_check.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void ASSERT_CLUSTER_SIZES(
3737
const std::vector<size_t> & p_expected_cluster_length,
3838
const index_sequence & p_indexes)
3939
{
40-
ASSERT_CLUSTER_NOISE_SIZES(p_data, p_actual_clusters, p_expected_cluster_length, {}, -1, p_indexes);
40+
ASSERT_CLUSTER_NOISE_SIZES(p_data, p_actual_clusters, p_expected_cluster_length, { }, -1, p_indexes);
4141
}
4242

4343

@@ -75,7 +75,10 @@ void ASSERT_CLUSTER_NOISE_SIZES(
7575
ASSERT_EQ(total_size, unique_objects.size());
7676

7777
if (!p_expected_cluster_length.empty()) {
78-
std::size_t expected_total_size = std::accumulate(p_expected_cluster_length.cbegin(), p_expected_cluster_length.cend(), (std::size_t) 0) + p_expected_noise_length;
78+
std::size_t expected_total_size = std::accumulate(p_expected_cluster_length.cbegin(), p_expected_cluster_length.cend(), (std::size_t) 0);
79+
if (p_expected_noise_length != (std::size_t) -1) {
80+
expected_total_size += p_expected_noise_length;
81+
}
7982

8083
ASSERT_EQ(expected_total_size, total_size);
8184

ccore/tst/utest-clique.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ template_clique_length_process_data(
5050
const noise & noise = output_result.noise();
5151
const clique_block_sequence & blocks = output_result.blocks();
5252

53+
for (auto & block : blocks) {
54+
ASSERT_TRUE(block.is_visited());
55+
}
56+
5357
ASSERT_CLUSTER_NOISE_SIZES(data, actual_clusters, p_expected_cluster_length, noise, p_expected_noise_length);
5458
}
5559

0 commit comments

Comments
 (0)