Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a wee bit more coverage. #12

Merged
merged 1 commit into from
Apr 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,12 @@ func TestServerWSErrorSession(t *testing.T) {
}

// Should not be able to grow room limitation.
testSrvr.cMngr.SetMaxRooms(2)
n = testSrvr.cMngr.MaxRooms()
if n != 2 {
t.Errorf("Set/Get Max Room Error.\nExpected: 2\n\nActual: %d\n", n)
}

if _, err := ws1.Write([]byte(TestServerJoin2)); err != nil {
if err != nil {
t.Errorf("Websocket send error: %s", err)
Expand Down Expand Up @@ -845,7 +851,11 @@ func TestServerWSErrorSession(t *testing.T) {
}

// Test Max timeout
testSrvr.info.MaxIdle = 3 // Set to 3 seconds
testSrvr.cMngr.SetMaxIdle(3) // Set to 3 seconds
n = testSrvr.cMngr.MaxIdle()
if n != 3 {
t.Errorf("Set/Get Max Idle time Error.\nExpected: 3\n\nActual: %d\n", n)
}
// Now, send a command to enable the new MaxIdle
if _, err := ws1.Write([]byte(TestServerListRooms)); err != nil {
if err != nil {
Expand All @@ -866,7 +876,7 @@ func TestServerWSErrorSession(t *testing.T) {
t.Errorf("Websocket should have been closed.")
}
}
testSrvr.info.MaxIdle = 0 // Reset
testSrvr.cMngr.SetMaxIdle(0) // Reset
}

func TestHTTPRoutes(t *testing.T) {
Expand Down