Skip to content

Commit

Permalink
Change type of ConnectionState constants
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed May 10, 2023
1 parent ca9de18 commit c2756c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ func (a *Agent) connectivityChecks() {
a.updateConnectionState(ConnectionStateFailed)
return
}
default:
}

a.selector.ContactCandidates()
Expand Down
5 changes: 4 additions & 1 deletion agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ func TestConnectionStateCallback(t *testing.T) {
close(isFailed)
case ConnectionStateClosed:
close(isClosed)
default:
}
})
if err != nil {
Expand Down Expand Up @@ -1161,9 +1162,9 @@ func TestConnectionStateConnectingToFailed(t *testing.T) {
isFailed.Done()
case ConnectionStateChecking:
isChecking.Done()
case ConnectionStateConnected:
case ConnectionStateCompleted:
t.Errorf("Unexpected ConnectionState: %v", c)
default:
}
}

Expand Down Expand Up @@ -1357,6 +1358,7 @@ func TestCloseInConnectionStateCallback(t *testing.T) {
assert.NoError(t, aAgent.Close())
case ConnectionStateClosed:
close(isClosed)
default:
}
})
if err != nil {
Expand Down Expand Up @@ -1513,6 +1515,7 @@ func TestLiteLifecycle(t *testing.T) {
close(bDisconnected)
case ConnectionStateFailed:
close(bFailed)
default:
}
}))

Expand Down
2 changes: 1 addition & 1 deletion ice.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type ConnectionState int
// List of supported States
const (
// ConnectionStateUnknown represents an unknown state
ConnectionStateUnknown = iota
ConnectionStateUnknown ConnectionState = iota

// ConnectionStateNew ICE agent is gathering addresses
ConnectionStateNew
Expand Down

0 comments on commit c2756c1

Please sign in to comment.