Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSnow committed Apr 29, 2017
1 parent 27e1722 commit b810cbe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
20 changes: 10 additions & 10 deletions engine/MsgLogging.go
Expand Up @@ -25,16 +25,16 @@ type msglist struct {
}

type MsgLog struct {
Enable bool
sem sync.Mutex
MsgList []*msglist
Last interfaces.Timestamp
all bool
nodeCnt int

start interfaces.Timestamp
msgCnt int
msgPerSec int
Enable bool
sem sync.Mutex
MsgList []*msglist
Last interfaces.Timestamp
all bool
nodeCnt int

start interfaces.Timestamp
msgCnt int
msgPerSec int

// The last period (msg rate over the last period, so msg changes can be seen)
Period int64
Expand Down
23 changes: 10 additions & 13 deletions engine/MsgLogging_test.go
Expand Up @@ -2,17 +2,14 @@ package engine_test

import (
"testing"
"time"

. "github.com/FactomProject/factomd/engine"
"github.com/FactomProject/factomd/state"
"github.com/FactomProject/factomd/common/messages"
"github.com/FactomProject/factomd/common/primitives"

"time"
. "github.com/FactomProject/factomd/engine"
"github.com/FactomProject/factomd/state"
)



func TestMessageLoging(t *testing.T) {
msgLog := new(MsgLog)
msgLog.Init(true, 0)
Expand All @@ -29,20 +26,20 @@ func TestMessageLoging(t *testing.T) {

msgLog.PrtMsgs(s)

msgLog.Add2(fnode, true, "peer","where",true,msg)
msgLog.Add2(fnode, false, "peer","where",true,msg)
msgLog.Add2(fnode, true, "peer", "where", true, msg)
msgLog.Add2(fnode, false, "peer", "where", true, msg)

msgLog.Startp = primitives.NewTimestampFromMilliseconds(0)
msgLog.Add2(fnode, false, "peer","where",true,msg)
msgLog.Add2(fnode, false, "peer", "where", true, msg)

if len(msgLog.MsgList) != 3 {
t.Error("Should have three entries")
}
msgLog.PrtMsgs(s)
msgLog.Last.SetTimeSeconds(msgLog.Last.GetTimeSeconds()-6)
time.Sleep(10*time.Millisecond)
msgLog.Add2(fnode, false, "peer","where",true,msg)

msgLog.Last.SetTimeSeconds(msgLog.Last.GetTimeSeconds() - 6)
time.Sleep(10 * time.Millisecond)
msgLog.Add2(fnode, false, "peer", "where", true, msg)

if len(msgLog.MsgList) != 0 {
t.Error("Should have zero messages")
Expand Down
7 changes: 1 addition & 6 deletions state/stateConsensus_test.go
Expand Up @@ -4,9 +4,4 @@

package state_test

import (

)



import ()

0 comments on commit b810cbe

Please sign in to comment.