@ -81,12 +81,12 @@ func TestReader(t *testing.T) {
// Active, Bytes, Samples, InstRate, CurRate, AvgRate, PeakRate, BytesRem, Start, Duration, Idle, TimeRem, Progress
want := [ ] Status {
{ true , 0 , 0 , 0 , 0 , 0 , 0 , 0 , start , 0 , 0 , 0 , 0 } ,
{ true , 10 , 1 , 100 , 100 , 100 , 100 , 0 , start , _100ms , 0 , 0 , 0 } ,
{ true , 20 , 2 , 100 , 100 , 100 , 100 , 0 , start , _200ms , _100ms , 0 , 0 } ,
{ true , 20 , 3 , 0 , 90 , 67 , 100 , 0 , start , _300ms , _200ms , 0 , 0 } ,
{ false , 20 , 3 , 0 , 0 , 67 , 100 , 0 , start , _300ms , 0 , 0 , 0 } ,
{ false , 20 , 3 , 0 , 0 , 67 , 100 , 0 , start , _300ms , 0 , 0 , 0 } ,
{ start , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , true } ,
{ start , 10 , 1 , 100 , 100 , 100 , 100 , 0 , _100ms , 0 , 0 , 0 , true } ,
{ start , 20 , 2 , 100 , 100 , 100 , 100 , 0 , _200ms , _100ms , 0 , 0 , true } ,
{ start , 20 , 3 , 0 , 90 , 67 , 100 , 0 , _300ms , _200ms , 0 , 0 , true } ,
{ start , 20 , 3 , 0 , 0 , 67 , 100 , 0 , _300ms , 0 , 0 , 0 , false } ,
{ start , 20 , 3 , 0 , 0 , 67 , 100 , 0 , _300ms , 0 , 0 , 0 , false } ,
}
for i , s := range status {
s := s
@ -140,9 +140,10 @@ func TestWriter(t *testing.T) {
// Active, Bytes, Samples, InstRate, CurRate, AvgRate, PeakRate, BytesRem, Start, Duration, Idle, TimeRem, Progress
want := [ ] Status {
{ true , 80 , 4 , 200 , 200 , 200 , 200 , 20 , start , _400ms , 0 , _100ms , 80000 } ,
{ true , 100 , 5 , 200 , 200 , 200 , 200 , 0 , start , _500ms , _100ms , 0 , 100000 } ,
{ start , 80 , 4 , 200 , 200 , 200 , 200 , 20 , _400ms , 0 , _100ms , 80000 , true } ,
{ start , 100 , 5 , 200 , 200 , 200 , 200 , 0 , _500ms , _100ms , 0 , 100000 , true } ,
}
for i , s := range status {
s := s
if ! statusesAreEqual ( & s , & want [ i ] ) {