MCPcopy Create free account
hub / github.com/Edgio/vflow / TestDecodeDataTpl

Function TestDecodeDataTpl

ipfix/decoder_test.go:215–232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestDecodeDataTpl(t *testing.T) {
216 var payload = []byte{0, 10, 1, 32, 92, 88, 61, 168, 0, 1, 117, 38, 0, 0, 0, 0, 4, 0, 0, 120, 0, 0, 1, 104, 184, 176, 218, 137, 0, 0, 1, 104, 184, 176, 211, 113, 0, 0, 0, 0, 0, 0, 3, 72, 0, 0, 0, 0, 0, 0, 0, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 2, 15, 216, 58, 215, 99, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 104, 184, 176, 218, 137, 0, 0, 1, 104, 184, 176, 211, 113, 0, 0, 0, 0, 0, 0, 3, 72, 0, 0, 0, 0, 0, 0, 0, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 58, 215, 99, 10, 0, 2, 15, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 88, 0, 0, 1, 104, 184, 172, 62, 242, 0, 0, 1, 104, 184, 172, 62, 242, 0, 0, 0, 0, 0, 0, 0, 189, 0, 0, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 128, 0, 0, 0, 0, 0, 0, 31, 12, 114, 32, 178, 94, 204, 189, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 0, 20, 233, 20, 233, 0, 17, 0, 0, 0, 4, 0, 0, 64, 0, 0, 1, 104, 184, 172, 62, 242, 0, 0, 1, 104, 184, 172, 62, 242, 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 2, 15, 224, 0, 0, 251, 20, 233, 20, 233, 0, 0, 17, 0, 0, 0}
217 var tpl = []byte{0, 10, 1, 32, 92, 88, 61, 152, 0, 1, 117, 22, 0, 0, 0, 0, 0, 2, 0, 68, 4, 0, 0, 15, 0, 153, 0, 8, 0, 152, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8, 0, 60, 0, 1, 0, 10, 0, 4, 0, 14, 0, 4, 0, 61, 0, 1, 0, 8, 0, 4, 0, 12, 0, 4, 0, 7, 0, 2, 0, 11, 0, 2, 0, 5, 0, 1, 0, 6, 0, 1, 0, 4, 0, 1, 0, 2, 0, 68, 4, 1, 0, 15, 0, 153, 0, 8, 0, 152, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8, 0, 60, 0, 1, 0, 10, 0, 4, 0, 14, 0, 4, 0, 61, 0, 1, 0, 8, 0, 4, 0, 12, 0, 4, 0, 7, 0, 2, 0, 11, 0, 2, 0, 5, 0, 1, 0, 6, 0, 1, 0, 4, 0, 1, 0, 2, 0, 68, 8, 0, 0, 15, 0, 153, 0, 8, 0, 152, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8, 0, 60, 0, 1, 0, 10, 0, 4, 0, 14, 0, 4, 0, 61, 0, 1, 0, 27, 0, 16, 0, 28, 0, 16, 0, 5, 0, 1, 0, 7, 0, 2, 0, 11, 0, 2, 0, 6, 0, 1, 0, 4, 0, 1, 0, 2, 0, 68, 8, 1, 0, 15, 0, 153, 0, 8, 0, 152, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8, 0, 60, 0, 1, 0, 10, 0, 4, 0, 14, 0, 4, 0, 61, 0, 1, 0, 27, 0, 16, 0, 28, 0, 16, 0, 5, 0, 1, 0, 7, 0, 2, 0, 11, 0, 2, 0, 6, 0, 1, 0, 4, 0, 1}
218
219 ip := net.ParseIP("127.0.0.1")
220 templates := GetCache("")
221 d := NewDecoder(ip, tpl)
222 _, err := d.Decode(templates)
223 if err != nil {
224 t.Error(err)
225 }
226
227 d = NewDecoder(ip, payload)
228 _, err = d.Decode(templates)
229 if err != nil {
230 t.Error(err)
231 }
232}

Callers

nothing calls this directly

Calls 3

DecodeMethod · 0.95
GetCacheFunction · 0.70
NewDecoderFunction · 0.70

Tested by

no test coverage detected