Prevent accidental setting of sync or timeout

This commit is contained in:
Daniel Smith
2014-08-08 13:50:04 -07:00
parent 49cded3800
commit 5dd130a350
5 changed files with 55 additions and 22 deletions

View File

@@ -264,6 +264,25 @@ func TestUintParam(t *testing.T) {
}
}
func TestUnacceptableParamNames(t *testing.T) {
table := []struct {
name string
testVal string
expectSuccess bool
}{
{"sync", "foo", false},
{"timeout", "42", false},
}
for _, item := range table {
c := New("", nil)
r := c.Get().setParam(item.name, item.testVal)
if e, a := item.expectSuccess, r.err == nil; e != a {
t.Errorf("expected %v, got %v (%v)", e, a, r.err)
}
}
}
func TestSetPollPeriod(t *testing.T) {
c := New("", nil)
r := c.Get()