File: integration.cpp

package info (click to toggle)
terraphast 0.0%2Bgit20200413.8af2e4c%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 792 kB
  • sloc: cpp: 5,923; sh: 83; ansic: 55; makefile: 25
file content (31 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <catch.hpp>

#include <terraces/advanced.hpp>
#include <terraces/constraints.hpp>
#include <terraces/parser.hpp>
#include <terraces/rooting.hpp>
#include <terraces/subtree_extraction.hpp>
namespace terraces {

namespace tests {

TEST_CASE("full_run_disjoint", "[rerooting],[tree_extraction],[constraints],[supertree]") {
	tree t{{none, 1, 2, none}, {0, 3, 4, none},    {0, none, none, 0},
	       {1, 5, 6, none},    {1, 7, 8, none},    {3, none, none, 1},
	       {3, none, none, 2}, {4, none, none, 3}, {4, none, none, 4}};
	bitmatrix b{5, 2};
	b.set(0, 0, true);
	b.set(0, 1, true);
	b.set(1, 1, true);
	b.set(2, 1, true);
	b.set(3, 0, true);
	b.set(4, 0, true);
	auto ts = subtrees(t, b);
	auto cs = compute_constraints(ts);
	auto names = name_map(t.size());
	index_t root = 0;
	CHECK(count_terrace({cs, 5, root}) == 15);
}

} // namespace tests
} // namespace terraces