File: codecgen_test.go

package info (click to toggle)
golang-github-ugorji-go-codec 0.0~git20151130.0.357a44b-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,520 kB
  • sloc: sh: 209; python: 94; makefile: 10
file content (24 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//+build x,codecgen

package codec

import (
	"fmt"
	"testing"
)

func _TestCodecgenJson1(t *testing.T) {
	// This is just a simplistic test for codecgen.
	// It is typically disabled. We only enable it for debugging purposes.
	const callCodecgenDirect bool = true
	v := newTestStruc(2, false, !testSkipIntf, false)
	var bs []byte
	e := NewEncoderBytes(&bs, testJsonH)
	if callCodecgenDirect {
		v.CodecEncodeSelf(e)
		e.w.atEndOfEncode()
	} else {
		e.MustEncode(v)
	}
	fmt.Printf("%s\n", bs)
}