Fix the tests
This commit is contained in:
parent
ddfe7d2e07
commit
bbd8c42de6
|
@ -28,14 +28,3 @@ func TestCompareLabels(t *testing.T) {
|
|||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestOffLabelFromRight(t *testing.T) {
|
||||
s1 := "www.miek.nl" // fqdn??
|
||||
|
||||
t.Log(offsetLabelFromRight(s1, 4))
|
||||
t.Log(offsetLabelFromRight(s1, 3))
|
||||
t.Log(offsetLabelFromRight(s1, 2))
|
||||
t.Log(offsetLabelFromRight(s1, 1))
|
||||
t.Log(offsetLabelFromRight(s1, 0))
|
||||
// t.Fail()
|
||||
}
|
||||
|
|
2
msg.go
2
msg.go
|
@ -1022,7 +1022,7 @@ func (dns *Msg) Pack() (msg []byte, ok bool) {
|
|||
dh.Arcount = uint16(len(extra))
|
||||
|
||||
// TODO: still too much, but better than 64K
|
||||
msg = make([]byte, dns.Len()*6)
|
||||
msg = make([]byte, dns.Len()*4)
|
||||
|
||||
// Pack it in: header and then the pieces.
|
||||
off := 0
|
||||
|
|
|
@ -76,7 +76,7 @@ Activate: 20110302104537`
|
|||
|
||||
func TestDotInName(t *testing.T) {
|
||||
buf := make([]byte, 20)
|
||||
PackDomainName("aa\\.bb.nl.", buf, 0)
|
||||
PackDomainName("aa\\.bb.nl.", buf, 0, nil)
|
||||
// index 3 must be a real dot
|
||||
if buf[3] != '.' {
|
||||
t.Log("Dot should be a real dot")
|
||||
|
@ -136,7 +136,7 @@ func TestDomainName(t *testing.T) {
|
|||
|
||||
|
||||
for _, ts := range tests {
|
||||
if _, ok := PackDomainName(ts, dbuff, 0); !ok {
|
||||
if _, ok := PackDomainName(ts, dbuff, 0, nil); !ok {
|
||||
t.Log("Not a valid domain name")
|
||||
t.Fail()
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue