Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
fd8e56c9
Commit
fd8e56c9
authored
Feb 12, 2021
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Fix interface checking on testing functions
parent
c2bfb0bb
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
keyExchange/utils_test.go
+2
-10
2 additions, 10 deletions
keyExchange/utils_test.go
storage/e2e/session.go
+1
-5
1 addition, 5 deletions
storage/e2e/session.go
storage/session.go
+1
-5
1 addition, 5 deletions
storage/session.go
with
4 additions
and
20 deletions
keyExchange/utils_test.go
+
2
−
10
View file @
fd8e56c9
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
storage/e2e/session.go
+
1
−
5
View file @
fd8e56c9
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
storage/session.go
+
1
−
5
View file @
fd8e56c9
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment