mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-20 06:10:00 -08:00
Use a RWMutex for server config locking instead of routing config gets and sets through Server#handler.
This commit is contained in:
parent
41f6af2334
commit
c785c45166
5 changed files with 62 additions and 61 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
func TestIntValue(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg := New(nil)
|
||||
cfg.Set("Test", "13")
|
||||
if cfg.IntValue("Test") != 13 {
|
||||
t.Errorf("Expected 13")
|
||||
|
|
@ -17,7 +17,7 @@ func TestIntValue(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestFloatAsInt(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg := New(nil)
|
||||
cfg.Set("Test", "13.4")
|
||||
if cfg.IntValue("Test") != 0 {
|
||||
t.Errorf("Expected 0")
|
||||
|
|
@ -25,14 +25,14 @@ func TestFloatAsInt(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDefaultValue(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg := New(nil)
|
||||
if cfg.IntValue("MaxBandwidth") != 72000 {
|
||||
t.Errorf("Expected 72000")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBoolValue(t *testing.T) {
|
||||
cfg := make(Config)
|
||||
cfg := New(nil)
|
||||
cfg.Set("DoStuffOnStartup", "true")
|
||||
if cfg.BoolValue("DoStuffOnStartup") != true {
|
||||
t.Errorf("Expected true")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue