@@ -78,22 +78,22 @@ func testPoFunc(k Address) (ret uint8) {
7878 return uint8 (Proximity (basekey , k [:]))
7979}
8080
81- func testDbStoreRandom (n int , chunksize int64 , mock bool , t * testing.T ) {
81+ func testDbStoreRandom (n int , mock bool , t * testing.T ) {
8282 db , cleanup , err := newTestDbStore (mock , true )
8383 defer cleanup ()
8484 if err != nil {
8585 t .Fatalf ("init dbStore failed: %v" , err )
8686 }
87- testStoreRandom (db , n , chunksize , t )
87+ testStoreRandom (db , n , t )
8888}
8989
90- func testDbStoreCorrect (n int , chunksize int64 , mock bool , t * testing.T ) {
90+ func testDbStoreCorrect (n int , mock bool , t * testing.T ) {
9191 db , cleanup , err := newTestDbStore (mock , false )
9292 defer cleanup ()
9393 if err != nil {
9494 t .Fatalf ("init dbStore failed: %v" , err )
9595 }
96- testStoreCorrect (db , n , chunksize , t )
96+ testStoreCorrect (db , n , t )
9797}
9898
9999func TestMarkAccessed (t * testing.T ) {
@@ -137,35 +137,35 @@ func TestMarkAccessed(t *testing.T) {
137137}
138138
139139func TestDbStoreRandom_1 (t * testing.T ) {
140- testDbStoreRandom (1 , 0 , false , t )
140+ testDbStoreRandom (1 , false , t )
141141}
142142
143143func TestDbStoreCorrect_1 (t * testing.T ) {
144- testDbStoreCorrect (1 , 4096 , false , t )
144+ testDbStoreCorrect (1 , false , t )
145145}
146146
147147func TestDbStoreRandom_1k (t * testing.T ) {
148- testDbStoreRandom (1000 , 0 , false , t )
148+ testDbStoreRandom (1000 , false , t )
149149}
150150
151151func TestDbStoreCorrect_1k (t * testing.T ) {
152- testDbStoreCorrect (1000 , 4096 , false , t )
152+ testDbStoreCorrect (1000 , false , t )
153153}
154154
155155func TestMockDbStoreRandom_1 (t * testing.T ) {
156- testDbStoreRandom (1 , 0 , true , t )
156+ testDbStoreRandom (1 , true , t )
157157}
158158
159159func TestMockDbStoreCorrect_1 (t * testing.T ) {
160- testDbStoreCorrect (1 , 4096 , true , t )
160+ testDbStoreCorrect (1 , true , t )
161161}
162162
163163func TestMockDbStoreRandom_1k (t * testing.T ) {
164- testDbStoreRandom (1000 , 0 , true , t )
164+ testDbStoreRandom (1000 , true , t )
165165}
166166
167167func TestMockDbStoreCorrect_1k (t * testing.T ) {
168- testDbStoreCorrect (1000 , 4096 , true , t )
168+ testDbStoreCorrect (1000 , true , t )
169169}
170170
171171func testDbStoreNotFound (t * testing.T , mock bool ) {
@@ -242,54 +242,38 @@ func TestMockIterator(t *testing.T) {
242242 testIterator (t , true )
243243}
244244
245- func benchmarkDbStorePut (n int , processors int , chunksize int64 , mock bool , b * testing.B ) {
245+ func benchmarkDbStorePut (n int , mock bool , b * testing.B ) {
246246 db , cleanup , err := newTestDbStore (mock , true )
247247 defer cleanup ()
248248 if err != nil {
249249 b .Fatalf ("init dbStore failed: %v" , err )
250250 }
251- benchmarkStorePut (db , n , chunksize , b )
251+ benchmarkStorePut (db , n , b )
252252}
253253
254- func benchmarkDbStoreGet (n int , processors int , chunksize int64 , mock bool , b * testing.B ) {
254+ func benchmarkDbStoreGet (n int , mock bool , b * testing.B ) {
255255 db , cleanup , err := newTestDbStore (mock , true )
256256 defer cleanup ()
257257 if err != nil {
258258 b .Fatalf ("init dbStore failed: %v" , err )
259259 }
260- benchmarkStoreGet (db , n , chunksize , b )
260+ benchmarkStoreGet (db , n , b )
261261}
262262
263- func BenchmarkDbStorePut_1_500 (b * testing.B ) {
264- benchmarkDbStorePut (500 , 1 , 4096 , false , b )
263+ func BenchmarkDbStorePut_500 (b * testing.B ) {
264+ benchmarkDbStorePut (500 , false , b )
265265}
266266
267- func BenchmarkDbStorePut_8_500 (b * testing.B ) {
268- benchmarkDbStorePut (500 , 8 , 4096 , false , b )
267+ func BenchmarkDbStoreGet_500 (b * testing.B ) {
268+ benchmarkDbStoreGet (500 , false , b )
269269}
270270
271- func BenchmarkDbStoreGet_1_500 (b * testing.B ) {
272- benchmarkDbStoreGet (500 , 1 , 4096 , false , b )
271+ func BenchmarkMockDbStorePut_500 (b * testing.B ) {
272+ benchmarkDbStorePut (500 , true , b )
273273}
274274
275- func BenchmarkDbStoreGet_8_500 (b * testing.B ) {
276- benchmarkDbStoreGet (500 , 8 , 4096 , false , b )
277- }
278-
279- func BenchmarkMockDbStorePut_1_500 (b * testing.B ) {
280- benchmarkDbStorePut (500 , 1 , 4096 , true , b )
281- }
282-
283- func BenchmarkMockDbStorePut_8_500 (b * testing.B ) {
284- benchmarkDbStorePut (500 , 8 , 4096 , true , b )
285- }
286-
287- func BenchmarkMockDbStoreGet_1_500 (b * testing.B ) {
288- benchmarkDbStoreGet (500 , 1 , 4096 , true , b )
289- }
290-
291- func BenchmarkMockDbStoreGet_8_500 (b * testing.B ) {
292- benchmarkDbStoreGet (500 , 8 , 4096 , true , b )
275+ func BenchmarkMockDbStoreGet_500 (b * testing.B ) {
276+ benchmarkDbStoreGet (500 , true , b )
293277}
294278
295279// TestLDBStoreWithoutCollectGarbage tests that we can put a number of random chunks in the LevelDB store, and
@@ -302,7 +286,7 @@ func TestLDBStoreWithoutCollectGarbage(t *testing.T) {
302286 ldb .setCapacity (uint64 (capacity ))
303287 defer cleanup ()
304288
305- chunks , err := mputRandomChunks (ldb , n , int64 ( ch . DefaultSize ) )
289+ chunks , err := mputRandomChunks (ldb , n )
306290 if err != nil {
307291 t .Fatal (err .Error ())
308292 }
@@ -382,7 +366,7 @@ func testLDBStoreCollectGarbage(t *testing.T) {
382366 putCount = roundTarget
383367 }
384368 remaining -= putCount
385- chunks , err := mputRandomChunks (ldb , putCount , int64 ( ch . DefaultSize ) )
369+ chunks , err := mputRandomChunks (ldb , putCount )
386370 if err != nil {
387371 t .Fatal (err .Error ())
388372 }
@@ -429,7 +413,7 @@ func TestLDBStoreAddRemove(t *testing.T) {
429413 defer cleanup ()
430414
431415 n := 100
432- chunks , err := mputRandomChunks (ldb , n , int64 ( ch . DefaultSize ) )
416+ chunks , err := mputRandomChunks (ldb , n )
433417 if err != nil {
434418 t .Fatalf (err .Error ())
435419 }
@@ -576,7 +560,7 @@ func TestLDBStoreCollectGarbageAccessUnlikeIndex(t *testing.T) {
576560 ldb .setCapacity (uint64 (capacity ))
577561 defer cleanup ()
578562
579- chunks , err := mputRandomChunks (ldb , n , int64 ( ch . DefaultSize ) )
563+ chunks , err := mputRandomChunks (ldb , n )
580564 if err != nil {
581565 t .Fatal (err .Error ())
582566 }
@@ -589,7 +573,7 @@ func TestLDBStoreCollectGarbageAccessUnlikeIndex(t *testing.T) {
589573 t .Fatalf ("fail add chunk #%d - %s: %v" , i , chunks [i ].Address (), err )
590574 }
591575 }
592- _ , err = mputRandomChunks (ldb , 2 , int64 ( ch . DefaultSize ) )
576+ _ , err = mputRandomChunks (ldb , 2 )
593577 if err != nil {
594578 t .Fatal (err .Error ())
595579 }
@@ -621,7 +605,7 @@ func TestCleanIndex(t *testing.T) {
621605 ldb .setCapacity (uint64 (capacity ))
622606 defer cleanup ()
623607
624- chunks , err := mputRandomChunks (ldb , n , 4096 )
608+ chunks , err := mputRandomChunks (ldb , n )
625609 if err != nil {
626610 t .Fatal (err )
627611 }
@@ -752,7 +736,7 @@ func TestCleanIndex(t *testing.T) {
752736 }
753737
754738 // check that the iterator quits properly
755- chunks , err = mputRandomChunks (ldb , 4100 , 4096 )
739+ chunks , err = mputRandomChunks (ldb , 4100 )
756740 if err != nil {
757741 t .Fatal (err )
758742 }
0 commit comments