2018-08-30 21:13:27 +08:00
|
|
|
package mem
|
2018-08-30 20:44:50 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2018-08-30 21:13:27 +08:00
|
|
|
pstore "github.com/libp2p/go-libp2p-peerstore"
|
2018-08-30 20:44:50 +08:00
|
|
|
"github.com/libp2p/go-libp2p-peerstore/test"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInMemoryPeerstore(t *testing.T) {
|
2018-08-30 21:13:27 +08:00
|
|
|
test.TestPeerstore(t, func() (pstore.Peerstore, func()) {
|
2018-08-30 20:44:50 +08:00
|
|
|
return NewPeerstore(), nil
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestInMemoryAddrMgr(t *testing.T) {
|
2018-08-30 21:13:27 +08:00
|
|
|
test.TestAddrMgr(t, func() (pstore.AddrBook, func()) {
|
2018-08-30 20:44:50 +08:00
|
|
|
return &AddrManager{}, nil
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkInMemoryPeerstore(b *testing.B) {
|
2018-08-30 21:13:27 +08:00
|
|
|
test.BenchmarkPeerstore(b, func() (pstore.Peerstore, func()) {
|
2018-08-30 20:44:50 +08:00
|
|
|
return NewPeerstore(), nil
|
|
|
|
})
|
2018-08-30 21:13:27 +08:00
|
|
|
}
|