Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuuram committed Jun 6, 2019
1 parent ebb6bf3 commit f8f223a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
52 changes: 26 additions & 26 deletions options/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ func TestDumpHeader(t *testing.T) {
options.dumpHeader = true
retVal := options.DumpHeader()
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.dumpHeader = false
retVal = options.DumpHeader()
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -24,13 +24,13 @@ func TestDumpPayload(t *testing.T) {
options.dumpPayload = true
retVal := options.DumpPayload()
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.dumpPayload = false
retVal = options.DumpPayload()
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -40,13 +40,13 @@ func TestDumpAdaptationField(t *testing.T) {
options.dumpAdaptationField = true
retVal := options.DumpAdaptationField()
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.dumpAdaptationField = false
retVal = options.DumpAdaptationField()
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -56,13 +56,13 @@ func TestDumpPsi(t *testing.T) {
options.dumpPsi = true
retVal := options.DumpPsi()
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.dumpPsi = false
retVal = options.DumpPsi()
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -72,13 +72,13 @@ func TestDumpPesHeader(t *testing.T) {
options.dumpPesHeader = true
retVal := options.DumpPesHeader()
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.dumpPesHeader = false
retVal = options.DumpPesHeader()
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -88,13 +88,13 @@ func TestNotDumpTimestamp(t *testing.T) {
options.dumpTimestamp = true
retVal := options.DumpTimestamp()
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.dumpTimestamp = false
retVal = options.DumpTimestamp()
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -104,13 +104,13 @@ func TestSetDumpHeader(t *testing.T) {
options.SetDumpHeader(true)
retVal := options.dumpHeader
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.SetDumpHeader(false)
retVal = options.dumpHeader
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -120,13 +120,13 @@ func TestSetDumpPayload(t *testing.T) {
options.SetDumpPayload(true)
retVal := options.dumpPayload
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.SetDumpPayload(false)
retVal = options.dumpPayload
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -136,13 +136,13 @@ func TestSetDumpAdaptationField(t *testing.T) {
options.SetDumpAdaptationField(true)
retVal := options.dumpAdaptationField
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.SetDumpAdaptationField(false)
retVal = options.dumpAdaptationField
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -152,13 +152,13 @@ func TestSetDumpPsi(t *testing.T) {
options.SetDumpPsi(true)
retVal := options.dumpPsi
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.SetDumpPsi(false)
retVal = options.dumpPsi
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

Expand All @@ -168,28 +168,28 @@ func TestSetDumpPesHeader(t *testing.T) {
options.SetDumpPesHeader(true)
retVal := options.dumpPesHeader
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.SetDumpPesHeader(false)
retVal = options.dumpPesHeader
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}

func TestDumpTimestamp(t *testing.T) {
options := new(Options)

options.SetDumpTimestamp(true)
retVal := options.notDumpTimestamp
retVal := options.dumpTimestamp
if retVal != true {
t.Errorf("actual: true, But got %d", retVal)
t.Errorf("actual: true, But got %t", retVal)
}

options.SetDumpTimestamp(false)
retVal = options.notDumpTimestamp
retVal = options.dumpTimestamp
if retVal != false {
t.Errorf("actual: false, But got %d", retVal)
t.Errorf("actual: false, But got %t", retVal)
}
}
2 changes: 1 addition & 1 deletion tsparser/adaptation_field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestAdaptationFieldInitialize(t *testing.T) {
af1.Initialize(1, options)

if af1.pos != 1 {
t.Errorf("actual: 1, But got %s", af1.pos)
t.Errorf("actual: 1, But got %d", af1.pos)
}
if !af1.options.DumpHeader() {
t.Errorf("actual: true, But got false")
Expand Down
8 changes: 4 additions & 4 deletions tsparser/pes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ func TestPesInitialize(t *testing.T) {
p1.Initialize(1, 2, 3, 4)

if p1.pid != 1 {
t.Errorf("actual: 1, But got %s", p1.pid)
t.Errorf("actual: 1, But got %d", p1.pid)
}
if p1.pos != 2 {
t.Errorf("actual: 2, But got %s", p1.pos)
t.Errorf("actual: 2, But got %d", p1.pos)
}
if p1.prevPcr != 3 {
t.Errorf("actual: 3, But got %s", p1.prevPcr)
t.Errorf("actual: 3, But got %d", p1.prevPcr)
}
if p1.prevPcrPos != 4 {
t.Errorf("actual: 4, But got %s", p1.prevPcrPos)
t.Errorf("actual: 4, But got %d", p1.prevPcrPos)
}

data := []byte{
Expand Down
2 changes: 1 addition & 1 deletion tsparser/ts_packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestTsPacketInitialize(t *testing.T) {
tp1.Initialize(1, options)

if tp1.pos != 1 {
t.Errorf("actual: 1, But got %s", tp1.pos)
t.Errorf("actual: 1, But got %d", tp1.pos)
}
if !tp1.options.DumpHeader() {
t.Errorf("actual: true, But got false")
Expand Down

0 comments on commit f8f223a

Please sign in to comment.