| 1 | void test() { |
| 2 | vvi graph(2); |
| 3 | graph[0].push_back(1); |
| 4 | bool has_error; |
| 5 | vi res = tsort(2, graph, has_error); |
| 6 | assert_false(has_error); |
| 7 | assert_equal(0, res[0]); |
| 8 | assert_equal(1, res[1]); |
| 9 | |
| 10 | vvi graph2(2); |
| 11 | graph2[0].push_back(1); |
| 12 | graph2[1].push_back(0); |
| 13 | res = tsort(2, graph2, has_error); |
| 14 | assert_true(has_error); |
| 15 | |
| 16 | vvi graph3(3); |
| 17 | graph3[0].push_back(2); |
| 18 | graph3[1].push_back(0); |
| 19 | graph3[1].push_back(2); |
| 20 | res = tsort(3, graph3, has_error); |
| 21 | assert_false(has_error); |
| 22 | assert_equal(1, res[0]); |
| 23 | assert_equal(0, res[1]); |
| 24 | assert_equal(2, res[2]); |
| 25 | } |
| 26 | // vim: cc=60 ts=2 sts=2 sw=2: |
nothing calls this directly
no test coverage detected