MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test

Function test

code/data-structures/dancing_links.test.cpp:19–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void test() {
20 int N = 8;
21 dancing_links<int> left;
22 int *arr = new int[N];
23 for (int i = 0; i < N; i++) left.push_back(arr[i] = i + 1);
24 rec(left);
25 int at = 0;
26 do {
27 for (int i = 0; i < N; i++) {
28 assert_equal(arr[i], perms[at][i]);
29 }
30
31 at++;
32 } while(next_permutation(arr, arr + N));
33
34 assert(at == size(perms));
35
36 delete[] arr;
37}
38// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 3

recFunction · 0.85
push_backMethod · 0.80
assert_equalFunction · 0.50

Tested by

no test coverage detected