Skip to content

Commit 5f92ebe

Browse files
committed
clusterlin tests: compare with fuzz-provided topological sets
1 parent 6e37824 commit 5f92ebe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/fuzz/cluster_linearize.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,10 @@ FUZZ_TARGET(clusterlin_simple_finder)
707707
auto exhaustive = exh_finder.FindCandidateSet();
708708
assert(exhaustive.feerate == found.feerate);
709709
}
710+
711+
// Compare with a topological set read from the fuzz input.
712+
auto read_topo = ReadTopologicalSet(depgraph, todo, reader);
713+
if (read_topo.Any()) assert(found.feerate >= depgraph.FeeRate(read_topo));
710714
}
711715

712716
// Find a topologically valid subset of transactions to remove from the graph.
@@ -807,6 +811,10 @@ FUZZ_TARGET(clusterlin_search_finder)
807811
// Compare with AncestorCandidateFinder;
808812
auto anc = anc_finder.FindCandidateSet();
809813
assert(found.feerate >= anc.feerate);
814+
815+
// Compare with a topological set read from the fuzz input.
816+
auto read_topo = ReadTopologicalSet(depgraph, todo, reader);
817+
if (read_topo.Any()) assert(found.feerate >= depgraph.FeeRate(read_topo));
810818
}
811819

812820
// Find a topologically valid subset of transactions to remove from the graph.

0 commit comments

Comments
 (0)