mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
swarm/storage: add more tests cases
This commit is contained in:
parent
a43c8a9c36
commit
f42a58d39f
1 changed files with 8 additions and 8 deletions
|
|
@ -49,7 +49,7 @@ func newLDBStore(t *testing.T) (*LDBStore, func()) {
|
||||||
|
|
||||||
func TestMemStoreAndLDBStore(t *testing.T) {
|
func TestMemStoreAndLDBStore(t *testing.T) {
|
||||||
ldb, cleanup := newLDBStore(t)
|
ldb, cleanup := newLDBStore(t)
|
||||||
ldb.setCapacity(singletonSwarmDbCapacity)
|
ldb.setCapacity(50000)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
memStore := NewMemStore(ldb, defaultCacheCapacity)
|
memStore := NewMemStore(ldb, defaultCacheCapacity)
|
||||||
|
|
@ -67,13 +67,13 @@ func TestMemStoreAndLDBStore(t *testing.T) {
|
||||||
chunkSize: 4096,
|
chunkSize: 4096,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
n: 20001,
|
n: 9999,
|
||||||
|
chunkSize: 4096,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
n: 80001,
|
||||||
chunkSize: 4096,
|
chunkSize: 4096,
|
||||||
},
|
},
|
||||||
//{
|
|
||||||
//n: 50001,
|
|
||||||
//chunkSize: 4096,
|
|
||||||
//},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
@ -96,10 +96,10 @@ func TestMemStoreAndLDBStore(t *testing.T) {
|
||||||
if err == ErrChunkNotFound {
|
if err == ErrChunkNotFound {
|
||||||
_, err := ldb.Get(chunks[i].Key)
|
_, err := ldb.Get(chunks[i].Key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatalf("couldn't get chunk %v from ldb, got error: %v", i, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
t.Fatal(err)
|
t.Fatalf("got error from memstore: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue