MCPcopy
hub / github.com/grpc/grpc-go / compareConnState

Function compareConnState

credentials/xds/xds_client_test.go:272–284  ·  view source on GitHub ↗
(got, want tls.ConnectionState)

Source from the content-addressed store, hash-verified

270}
271
272func compareConnState(got, want tls.ConnectionState) error {
273 switch {
274 case got.Version != want.Version:
275 return fmt.Errorf("TLS.ConnectionState got Version: %v, want: %v", got.Version, want.Version)
276 case got.HandshakeComplete != want.HandshakeComplete:
277 return fmt.Errorf("TLS.ConnectionState got HandshakeComplete: %v, want: %v", got.HandshakeComplete, want.HandshakeComplete)
278 case got.CipherSuite != want.CipherSuite:
279 return fmt.Errorf("TLS.ConnectionState got CipherSuite: %v, want: %v", got.CipherSuite, want.CipherSuite)
280 case got.NegotiatedProtocol != want.NegotiatedProtocol:
281 return fmt.Errorf("TLS.ConnectionState got NegotiatedProtocol: %v, want: %v", got.NegotiatedProtocol, want.NegotiatedProtocol)
282 }
283 return nil
284}
285
286// TestClientCredsWithoutFallback verifies that the call to
287// NewClientCredentials() fails when no fallback is specified.

Callers 3

compareAuthInfoFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected