mirror of
https://github.com/miekg/dns.git
synced 2026-05-05 22:56:10 +02:00
Add (failing) test for zero rdata
This commit is contained in:
parent
744f895b6f
commit
cb9ec711f5
@ -90,8 +90,7 @@ func TestClientTsigAXFR(t *testing.T) {
|
||||
|
||||
if a, err := c.TransferIn(m, "37.251.95.53:53"); err != nil {
|
||||
t.Log("Failed to setup axfr: " + err.Error())
|
||||
t.Fail()
|
||||
return
|
||||
t.Fatal()
|
||||
} else {
|
||||
for ex := range a {
|
||||
if ex.Error != nil {
|
||||
|
||||
13
dns_test.go
13
dns_test.go
@ -240,3 +240,16 @@ func TestToRFC3597(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoRdata(t *testing.T) {
|
||||
data := make([]byte, 1024)
|
||||
for typ, _ := range TypeToString {
|
||||
r := rr_mk[typ]()
|
||||
*r.Header() = RR_Header{Name: "miek.nl.", Rrtype: typ, Class: ClassINET, Ttl: 3600}
|
||||
_, e := PackRR(r, data, 0, nil, false)
|
||||
if e != nil {
|
||||
t.Logf("Failed to pack rdata zero RR %d: %s\n", typ, e.Error())
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user