Beispiel #1
0
func (t *VisitTest) LargeRootedTree() {
	// Set up a random tree.
	depth := 6
	if syncutil.InvariantCheckingEnabled() {
		depth = 5
	}

	edges := randomTree(depth)
	startNodes := []string{"root"}

	// Run the test. Use a small delay since the graph may be quite large.
	t.maxDelay = 100 * time.Microsecond
	t.runTest(edges, startNodes)
}
Beispiel #2
0
func (t *VisitTest) LargeRootedTree_Inverted() {
	// Set up a random tree and invert it.
	depth := 6
	if syncutil.InvariantCheckingEnabled() {
		depth = 5
	}

	origEdges := randomTree(depth)
	edges := invertRelation(origEdges)

	// Use the leaves in the original tree as the start nodes.
	var startNodes []string
	for n, deps := range origEdges {
		if len(deps) == 0 {
			startNodes = append(startNodes, n)
		}
	}

	// Run the test. Use a small delay since the graph may be quite large.
	t.maxDelay = 100 * time.Microsecond
	t.runTest(edges, startNodes)
}