Change type of ConnectionState constants

This commit is contained in:
Steffen Vogel
2023-05-10 16:33:20 +02:00
parent ca9de18fd6
commit c2756c121d
3 changed files with 6 additions and 2 deletions
+1
View File
@@ -435,6 +435,7 @@ func (a *Agent) connectivityChecks() {
a.updateConnectionState(ConnectionStateFailed)
return
}
default:
}
a.selector.ContactCandidates()
+4 -1
View File
@@ -582,6 +582,7 @@ func TestConnectionStateCallback(t *testing.T) {
close(isFailed)
case ConnectionStateClosed:
close(isClosed)
default:
}
})
if err != nil {
@@ -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:
}
}
@@ -1357,6 +1358,7 @@ func TestCloseInConnectionStateCallback(t *testing.T) {
assert.NoError(t, aAgent.Close())
case ConnectionStateClosed:
close(isClosed)
default:
}
})
if err != nil {
@@ -1513,6 +1515,7 @@ func TestLiteLifecycle(t *testing.T) {
close(bDisconnected)
case ConnectionStateFailed:
close(bFailed)
default:
}
}))
+1 -1
View File
@@ -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