(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestAdd(t *testing.T) { |
| 81 | kms.Unittest = true |
| 82 | utils.RemoveAll(testStorePath + "*") |
| 83 | kms.ResetBucket() |
| 84 | |
| 85 | x, _ := InitConsistent(testStorePath, new(KMSStorage), false) |
| 86 | defer utils.RemoveAll(testStorePath + "*") |
| 87 | x.Add(NewNodeFromString("0000000000000000000000000000000000000000000000000000000000000000")) |
| 88 | CheckNum(len(x.circle), x.NumberOfReplicas, t) |
| 89 | CheckNum(len(x.sortedHashes), x.NumberOfReplicas, t) |
| 90 | if sort.IsSorted(x.sortedHashes) == false { |
| 91 | t.Error("expected sorted hashes to be sorted") |
| 92 | } |
| 93 | x.Add(NewNodeFromString(("3333333333333333333333333333333333333333333333333333333333333333"))) |
| 94 | CheckNum(len(x.circle), 2*x.NumberOfReplicas, t) |
| 95 | CheckNum(len(x.sortedHashes), 2*x.NumberOfReplicas, t) |
| 96 | if sort.IsSorted(x.sortedHashes) == false { |
| 97 | t.Error("expected sorted hashes to be sorted") |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func TestRemove(t *testing.T) { |
| 102 | kms.Unittest = true |
nothing calls this directly
no test coverage detected