Skip to content
Snippets Groups Projects
Commit 05fdb4b1 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

added a testing implementation of new manager

parent c574947b
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/primitives/id" "gitlab.com/elixxir/primitives/id"
"sync" "sync"
"testing"
) )
// The Manager object provides thread-safe access // The Manager object provides thread-safe access
...@@ -32,6 +33,13 @@ func newManager() *Manager { ...@@ -32,6 +33,13 @@ func newManager() *Manager {
} }
} }
func NewManagerTesting(t *testing.T) *Manager {
if t == nil {
jww.FATAL.Panicf("NewMangerTesting is for testing only")
}
return newManager()
}
// Fetch a Host from the internal map // Fetch a Host from the internal map
func (m *Manager) GetHost(hostId *id.ID) (*Host, bool) { func (m *Manager) GetHost(hostId *id.ID) (*Host, bool) {
m.mux.RLock() m.mux.RLock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment