@@ -56,7 +56,6 @@ func TestNew(t *testing.T) {
5656 if x == nil {
5757 t .Errorf ("expected obj" )
5858 }
59- utils .CheckNum (x .NumberOfReplicas , 20 , t )
6059}
6160
6261func TestAdd (t * testing.T ) {
@@ -67,14 +66,14 @@ func TestAdd(t *testing.T) {
6766 x , _ := InitConsistent (testStorePath , false )
6867 defer os .Remove (testStorePath )
6968 x .Add (NewNodeFromID ("abcdefg" ))
70- utils .CheckNum (len (x .circle ), 20 , t )
71- utils .CheckNum (len (x .sortedHashes ), 20 , t )
69+ utils .CheckNum (len (x .circle ), x . NumberOfReplicas , t )
70+ utils .CheckNum (len (x .sortedHashes ), x . NumberOfReplicas , t )
7271 if sort .IsSorted (x .sortedHashes ) == false {
7372 t .Errorf ("expected sorted hashes to be sorted" )
7473 }
7574 x .Add (NewNodeFromID (("qwer" )))
76- utils .CheckNum (len (x .circle ), 40 , t )
77- utils .CheckNum (len (x .sortedHashes ), 40 , t )
75+ utils .CheckNum (len (x .circle ), 2 * x . NumberOfReplicas , t )
76+ utils .CheckNum (len (x .sortedHashes ), 2 * x . NumberOfReplicas , t )
7877 if sort .IsSorted (x .sortedHashes ) == false {
7978 t .Errorf ("expected sorted hashes to be sorted" )
8079 }
@@ -102,7 +101,7 @@ func TestRemoveNonExisting(t *testing.T) {
102101 defer os .Remove (testStorePath )
103102 x .Add (NewNodeFromID ("abcdefg" ))
104103 x .Remove ("abcdefghijk" )
105- utils .CheckNum (len (x .circle ), 20 , t )
104+ utils .CheckNum (len (x .circle ), x . NumberOfReplicas , t )
106105}
107106
108107func TestGetEmpty (t * testing.T ) {
0 commit comments