From d6f82fd518a517ce630b8391d17cdf2987311d07 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 21 Dec 2017 13:27:36 +1030 Subject: [PATCH] Nal struct complete --- packets/packets_test.go | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) 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{ }