sendTestMessages sends [testMessagesCount] DNS requests to the specified connection and checks the responses.
(tb testing.TB, conn *dns.Conn)
| 80 | // sendTestMessages sends [testMessagesCount] DNS requests to the specified |
| 81 | // connection and checks the responses. |
| 82 | func sendTestMessages(tb testing.TB, conn *dns.Conn) { |
| 83 | tb.Helper() |
| 84 | |
| 85 | for i := range testMessagesCount { |
| 86 | req := newTestMessage() |
| 87 | err := conn.WriteMsg(req) |
| 88 | require.NoErrorf(tb, err, "req number %d", i) |
| 89 | |
| 90 | res, err := conn.ReadMsg() |
| 91 | require.NoErrorf(tb, err, "resp number %d", i) |
| 92 | |
| 93 | requireResponse(tb, req, res) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func newTestMessage() *dns.Msg { |
| 98 | return newHostTestMessage("google-public-dns-a.google.com") |
no test coverage detected
searching dependent graphs…