Nal struct complete

This commit is contained in:
Unknown 2017-12-21 13:27:36 +10:30
parent 49d57f3a28
commit d6f82fd518
1 changed files with 31 additions and 3 deletions

View File

@ -201,7 +201,8 @@ func TestNalFragmentParsing(t *testing.T) {
} }
for ii := range fields { for ii := range fields {
if !reflect.DeepEqual(fields[ii],expectedParsing[ii]) { 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){ 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){ 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){ 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{
} }