Add (failing) test for zero rdata

This commit is contained in:
Miek Gieben 2013-08-25 21:38:10 -07:00
parent 744f895b6f
commit cb9ec711f5
2 changed files with 14 additions and 2 deletions

View File

@ -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 {

View File

@ -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()
}
}
}