(t *testing.T)
| 309 | } |
| 310 | |
| 311 | func TestGetTwo(t *testing.T) { |
| 312 | kms.Unittest = true |
| 313 | utils.RemoveAll(testStorePath + "*") |
| 314 | kms.ResetBucket() |
| 315 | |
| 316 | x, _ := InitConsistent(testStorePath, new(KMSStorage), false) |
| 317 | defer utils.RemoveAll(testStorePath + "*") |
| 318 | x.Add(NewNodeFromString("0000000000000000000000000000000000000000000000000000000000000000")) |
| 319 | x.Add(NewNodeFromString("1111111111111111111111111111111111111111111111111111111111111111")) |
| 320 | x.Add(NewNodeFromString("2222222222222222222222222222222222222222222222222222222222222222")) |
| 321 | a, b, err := x.GetTwoNeighbors("9999999999999999999999999999999999999999999999999999999999999999") |
| 322 | if err != nil { |
| 323 | t.Fatal(err) |
| 324 | } |
| 325 | if a.ID == b.ID { |
| 326 | t.Error("a shouldn't equal b") |
| 327 | } |
| 328 | if a.ID != "0000000000000000000000000000000000000000000000000000000000000000" { |
| 329 | t.Errorf("wrong a: %v", a) |
| 330 | } |
| 331 | if b.ID != "1111111111111111111111111111111111111111111111111111111111111111" { |
| 332 | t.Errorf("wrong b: %v", b) |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | func TestGetTwoEmpty(t *testing.T) { |
| 337 | kms.Unittest = true |
nothing calls this directly
no test coverage detected