Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodauria committed Feb 20, 2020
1 parent 04b346f commit e7ed019
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cmd/ndt7-client/internal/emitter/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ func TestJSONOnSummary(t *testing.T) {
}
if output.ClientIP != summary.ClientIP ||
output.ServerFQDN != summary.ServerFQDN ||
output.ServerIP != summary.ServerIP ||
output.DownloadUUID != summary.DownloadUUID ||
output.Download != summary.Download ||
output.Upload != summary.Upload ||
output.DownloadRetrans != summary.DownloadRetrans ||
Expand Down
12 changes: 8 additions & 4 deletions cmd/ndt7-client/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ func TestMakeSummary(t *testing.T) {
},
},
ConnectionInfo: &spec.ConnectionInfo{
Client: "127.0.0.1",
Server: "test",
Client: "127.0.0.1:12345",
Server: "127.0.0.2:443",
UUID: "test-uuid",
},
Server: spec.Measurement{
TCPInfo: tcpInfo,
Expand All @@ -352,8 +353,10 @@ func TestMakeSummary(t *testing.T) {
}

expected := &emitter.Summary{
ClientIP: "127.0.0.1",
ServerFQDN: "test",
ServerFQDN: "test",
ClientIP: "127.0.0.1",
ServerIP: "127.0.0.2",
DownloadUUID: "test-uuid",
Download: emitter.ValueUnitPair{
Value: 800.0,
Unit: "Mbit/s",
Expand All @@ -373,6 +376,7 @@ func TestMakeSummary(t *testing.T) {
}

generated := makeSummary("test", results)

if !reflect.DeepEqual(generated, expected) {
t.Fatal("makeSummary(): unexpected summary data")
}
Expand Down

0 comments on commit e7ed019

Please sign in to comment.