diff --git a/packets/packets_test.go b/packets/packets_test.go index 8f57221c..58b1811d 100644 --- a/packets/packets_test.go +++ b/packets/packets_test.go @@ -201,7 +201,8 @@ func TestNalFragmentParsing(t *testing.T) { } for ii := range fields { if !reflect.DeepEqual(fields[ii],expectedParsing[ii]) { - t.Errorf("Bad Parsing! Field: %v wanted: %v got: %v\n",ii,expectedParsing[ii],fields[ii]) + t.Errorf("Bad Parsing! Field: %v wanted: %v got: %v\n",ii,expectedParsing[ii], + fields[ii]) } } } @@ -226,13 +227,40 @@ func TestNalFragmentType(t *testing.T){ } func TestNalSpsPpsParsing(t *testing.T){ - NalSps := ParseNALSpsPps(parseInput) + nalSpsPps := ParseNALSpsPps(parseInput) + for ii := range parseInput { + if nalSpsPps.Data[ii] != parseInput[ii] { + t.Errorf("Bad Parsing! Byte: %v wanted: %v got: %v\n",ii,parseInput[ii], + nalSpsPps.Data[ii]) + } + } } func TestNalSpsPpsToByteSlice(t *testing.T){ - + nalSpsPps := ParseNALSpsPps(parseInput) + nalSpsPpsByteSlice := nalSpsPps.ToByteSlice() + for ii := range parseInput { + if nalSpsPpsByteSlice[ii] != parseInput[ii] { + t.Errorf("Bad conversion to byte slice! Byte: %v wanted: %v got: %v\n",ii, + parseInput[ii],nalSpsPpsByteSlice[ii]) + } + } } func TestNalSpsPpsType(t *testing.T){ + nalSpsPps := ParseNALSpsPps(parseInput) + if nalSpsPps.GetType() != nalTestType { + t.Errorf("Returned wrong type!") + } +} + +/******************************************************* +Pes Packet testing! +********************************************************/ +var pesFieldValues = []interface{}{ + +} + +var pesExpectedOutput = []byte{ }