forked from gophergala/dnsp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils_test.go
More file actions
33 lines (30 loc) · 772 Bytes
/
utils_test.go
File metadata and controls
33 lines (30 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package ddns
import (
"testing"
)
func Test_backendHas(t *testing.T) {
hashExist := backendHash("www.163.com")
//hash := backendHash("Hello234")
/* must compatible with Python zlib.crc32('www.163.com') or binascii.crc32('www.163.com') */
if hashExist != 832174588 {
t.Errorf("%d", hashExist)
t.Error("test func *backendHash* error")
}
hashNil := backendHash("")
if hashNil != 0 {
t.Errorf("%d", hashNil)
t.Error("test func *backendHash* error")
}
}
func Test_channelHash(t *testing.T) {
hashExist := channelHash("www.163.com")
if hashExist != 684573356 {
t.Errorf("%d", hashExist)
t.Error("test func *channelHash* error")
}
hashNil := channelHash("")
if hashNil != 0 {
t.Errorf("%d", hashNil)
t.Error("test func *channelHash* error")
}
}