From 292a8a4a7f845a3f6f2cf5730dbe9989818be9e0 Mon Sep 17 00:00:00 2001 From: Tomasen Date: Thu, 3 Dec 2015 18:56:39 +0800 Subject: [PATCH] print memory allocation statistics for benchmarks. --- .travis.yml | 2 +- main_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4664c24..79b608c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,4 @@ script: after_script: - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci - - go test -bench . + - go test -benchmem -bench . diff --git a/main_test.go b/main_test.go index 31db7d1..73e9994 100644 --- a/main_test.go +++ b/main_test.go @@ -9,6 +9,7 @@ import ( "math/rand" "net" "os" + "strconv" "testing" "time" @@ -137,7 +138,7 @@ func TestEchoServer(t *testing.T) { func testProtocol(cipherAddr []byte) { // * test decryption - conn, err := net.Dial("tcp", "127.0.0.1:"+_DefaultPort) + conn, err := net.Dial("tcp", "127.0.0.1:"+strconv.Itoa(_DefaultPort)) if err != nil { panic(err) }