(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestInitBlockNode(t *testing.T) { |
| 76 | parent := newBlockNode(0, testBlocks[0], nil) |
| 77 | if parent == nil { |
| 78 | t.Fatal("unexpected result: nil") |
| 79 | } else if parent.parent != nil { |
| 80 | t.Fatalf("unexpected parent: %v", parent.parent) |
| 81 | } else if parent.count != 0 { |
| 82 | t.Fatalf("unexpected height: %d", parent.count) |
| 83 | } |
| 84 | |
| 85 | child := newBlockNode(1, testBlocks[1], parent) |
| 86 | if child == nil { |
| 87 | t.Fatal("unexpected result: nil") |
| 88 | } else if child.parent != parent { |
| 89 | t.Fatalf("unexpected parent: %v", child.parent) |
| 90 | } else if child.count != parent.count+1 { |
| 91 | t.Fatalf("unexpected height: %d", child.count) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestAncestor(t *testing.T) { |
| 96 | index := newBlockIndex() |
nothing calls this directly
no test coverage detected