all: update client and server

This commit is contained in:
Aleksandr Razumov
2016-05-11 16:53:35 +03:00
parent 1f6a032d28
commit 7434b6616c
8 changed files with 329 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
package stun
import "testing"
func TestErrorCode_Reason(t *testing.T) {
codes := [...]ErrorCode{
CodeTryAlternate,
CodeBadRequest,
CodeUnauthorised,
CodeUnknownAttribute,
CodeStaleNonce,
CodeServerError,
}
for _, code := range codes {
if code.Reason() == "Unknown Error" {
t.Error(code, "should not be unknown")
}
if len(code.Reason()) == 0 {
t.Error(code, "should not be blank")
}
}
if ErrorCode(999).Reason() != "Unknown Error" {
t.Error("999 error should be Unknown")
}
}