You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
voicebot/icsevent/datastruct_test.go

56 lines
846 B
Go

package icsevent
import (
"fmt"
"testing"
"gitlab.com/cinnamon/voiceagent/icserror"
)
func TestDataStruct(t *testing.T) {
var header *RRData
header = NewRRData()
for i := 0; i < 128; i++ {
err := Push(header, i)
if err != nil {
err.Print()
break
}
}
for i := 0; i < 128; i++ {
var data interface{}
var err *icserror.IcsError
//fmt.Printf("%p\n", header)
header, data, err = Pop(header)
if err != nil {
err.Print()
break
}
fmt.Printf("[%d]>>> %v\n", i, data)
}
for i := 0; i < 128; i++ {
err := Push(header, i)
if err != nil {
err.Print()
break
}
}
for i := 0; i < 128; i++ {
var data interface{}
var err *icserror.IcsError
//fmt.Printf("%p\n", header)
header, data, err = Pop(header)
if err != nil {
err.Print()
break
}
fmt.Printf("[%d]>>> %v\n", i, data)
}
}