(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestNewBlockNode(t *testing.T) { |
| 54 | parent := newBlockNode(0, testBlocks[0], nil) |
| 55 | |
| 56 | if parent == nil { |
| 57 | t.Fatal("unexpected result: nil") |
| 58 | } else if parent.parent != nil { |
| 59 | t.Fatalf("unexpected parent: %v", parent.parent) |
| 60 | } else if parent.count != 0 { |
| 61 | t.Fatalf("unexpected height: %d", parent.count) |
| 62 | } |
| 63 | |
| 64 | child := newBlockNode(1, testBlocks[1], parent) |
| 65 | |
| 66 | if child == nil { |
| 67 | t.Fatal("unexpected result: nil") |
| 68 | } else if child.parent != parent { |
| 69 | t.Fatalf("unexpected parent: %v", child.parent) |
| 70 | } else if child.count != parent.count+1 { |
| 71 | t.Fatalf("unexpected height: %d", child.count) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func TestInitBlockNode(t *testing.T) { |
| 76 | parent := newBlockNode(0, testBlocks[0], nil) |
nothing calls this directly
no test coverage detected