File: protobuf_test.go

package info (click to toggle)
golang-github-lightstep-lightstep-tracer-common 1.1.0%2Bgit20210210.a8dfcb8-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 428 kB
  • sloc: makefile: 68
file content (24 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package lightstep_tracer_common_test

import (
	"reflect"
	"testing"

	"github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb"
	"github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb/collectorpbfakes"
	"github.com/lightstep/lightstep-tracer-common/golang/protobuf/lightsteppb"
)

func TestProtoIsProtobuf(t *testing.T) {
	var r collectorpb.ReportRequest
	if ptag := reflect.ValueOf(r).Type().Field(0).Tag.Get("protobuf"); ptag == "" {
		panic("Not a protobuf!")
	}

	var c lightsteppb.BinaryCarrier
	if ptag := reflect.ValueOf(c).Type().Field(0).Tag.Get("protobuf"); ptag == "" {
		panic("Not a protobuf!")
	}

	_ = collectorpbfakes.FakeCollectorServiceClient{}
}