Skip to content
Snippets Groups Projects
Commit fd8e56c9 authored by Jono Wenger's avatar Jono Wenger
Browse files

Fix interface checking on testing functions

parent c2bfb0bb
No related branches found
No related tags found
No related merge requests found
...@@ -101,11 +101,7 @@ func (t *testNetworkManagerGeneric) GetStoppable() stoppable.Stoppable { ...@@ -101,11 +101,7 @@ func (t *testNetworkManagerGeneric) GetStoppable() stoppable.Stoppable {
func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) { func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
...@@ -208,11 +204,7 @@ func (t *testNetworkManagerFullExchange) GetStoppable() stoppable.Stoppable { ...@@ -208,11 +204,7 @@ func (t *testNetworkManagerFullExchange) GetStoppable() stoppable.Stoppable {
func InitTestingContextFullExchange(i interface{}) (*storage.Session, *switchboard.Switchboard, interfaces.NetworkManager) { func InitTestingContextFullExchange(i interface{}) (*storage.Session, *switchboard.Switchboard, interfaces.NetworkManager) {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......
...@@ -243,11 +243,7 @@ func getSessionIDFromBaseKey(baseKey *cyclic.Int) SessionID { ...@@ -243,11 +243,7 @@ func getSessionIDFromBaseKey(baseKey *cyclic.Int) SessionID {
// FOR TESTING PURPOSES ONLY // FOR TESTING PURPOSES ONLY
func GetSessionIDFromBaseKeyForTesting(baseKey *cyclic.Int, i interface{}) SessionID { func GetSessionIDFromBaseKeyForTesting(baseKey *cyclic.Int, i interface{}) SessionID {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("GetSessionIDFromBaseKeyForTesting is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("GetSessionIDFromBaseKeyForTesting is restricted to testing only. Got %T", i)
......
...@@ -290,11 +290,7 @@ func (s *Session) Delete(key string) error { ...@@ -290,11 +290,7 @@ func (s *Session) Delete(key string) error {
// FOR TESTING ONLY // FOR TESTING ONLY
func InitTestingSession(i interface{}) *Session { func InitTestingSession(i interface{}) *Session {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment