MCPcopy
hub / github.com/AdguardTeam/dnsproxy / requireResponse

Function requireResponse

proxy/proxy_internal_test.go:115–125  ·  view source on GitHub ↗
(tb testing.TB, req, reply *dns.Msg)

Source from the content-addressed store, hash-verified

113}
114
115func requireResponse(tb testing.TB, req, reply *dns.Msg) {
116 tb.Helper()
117
118 require.NotNil(tb, reply)
119 require.Lenf(tb, reply.Answer, 1, "wrong number of answers: %d", len(reply.Answer))
120 require.Equal(tb, req.Id, reply.Id)
121
122 a := testutil.RequireTypeAssert[*dns.A](tb, reply.Answer[0])
123
124 require.Equalf(tb, net.IPv4(8, 8, 8, 8), a.A.To16(), "wrong answer: %v", a.A)
125}
126
127func newTLSConfig(tb testing.TB) (conf *tls.Config, certPem []byte) {
128 tb.Helper()

Callers 10

checkDNSCryptProxyFunction · 0.70
sendTestQUICMessageFunction · 0.70
TestHttpsProxyFunction · 0.70
TestProxy_trustedProxiesFunction · 0.70
sendTestMessagesFunction · 0.70
TestFilteringHandlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…