MCPcopy Index your code
hub / github.com/godbus/dbus / TestEncodeMapStringNamedInterface

Function TestEncodeMapStringNamedInterface

encoder_test.go:91–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89type empty any
90
91func TestEncodeMapStringNamedInterface(t *testing.T) {
92 val := map[string]empty{"foo": "bar"}
93 buf := new(bytes.Buffer)
94 fds := make([]int, 0)
95 order := binary.LittleEndian
96 enc := newEncoder(buf, binary.LittleEndian, fds)
97 err := enc.Encode(val)
98 if err != nil {
99 t.Fatal(err)
100 }
101
102 dec := newDecoder(buf, order, enc.fds)
103 v, err := dec.Decode(SignatureOf(val))
104 if err != nil {
105 t.Fatal(err)
106 }
107 out := map[string]empty{}
108 if err := Store(v, &out); err != nil {
109 t.Fatal(err)
110 }
111 if !reflect.DeepEqual(out, val) {
112 t.Errorf("not equal: got '%v', want '%v'",
113 out, val)
114 }
115}
116
117type fooer interface {
118 Foo()

Callers

nothing calls this directly

Calls 6

newEncoderFunction · 0.85
newDecoderFunction · 0.85
SignatureOfFunction · 0.85
StoreFunction · 0.85
EncodeMethod · 0.80
DecodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…