MCPcopy
hub / github.com/gogo/protobuf / overify

Function overify

proto/all_test.go:177–209  ·  view source on GitHub ↗
(t *testing.T, pb *GoTest, expected string)

Source from the content-addressed store, hash-verified

175}
176
177func overify(t *testing.T, pb *GoTest, expected string) {
178 o := old()
179 err := o.Marshal(pb)
180 if err != nil {
181 fmt.Printf("overify marshal-1 err = %v", err)
182 o.DebugPrint("", o.Bytes())
183 t.Fatalf("expected = %s", expected)
184 }
185 if !equal(o.Bytes(), expected, t) {
186 o.DebugPrint("overify neq 1", o.Bytes())
187 t.Fatalf("expected = %s", expected)
188 }
189
190 // Now test Unmarshal by recreating the original buffer.
191 pbd := new(GoTest)
192 err = o.Unmarshal(pbd)
193 if err != nil {
194 t.Fatalf("overify unmarshal err = %v", err)
195 o.DebugPrint("", o.Bytes())
196 t.Fatalf("string = %s", expected)
197 }
198 o.Reset()
199 err = o.Marshal(pbd)
200 if err != nil {
201 t.Errorf("overify marshal-2 err = %v", err)
202 o.DebugPrint("", o.Bytes())
203 t.Fatalf("string = %s", expected)
204 }
205 if !equal(o.Bytes(), expected, t) {
206 o.DebugPrint("overify neq 2", o.Bytes())
207 t.Fatalf("string = %s", expected)
208 }
209}
210
211// Simple tests for numeric encode/decode primitives (varint, etc.)
212func TestNumericPrimitives(t *testing.T) {

Callers 6

TestEncodeDecode1Function · 0.85
TestEncodeDecode2Function · 0.85
TestEncodeDecode3Function · 0.85
TestEncodeDecode4Function · 0.85
TestEncodeDecode5Function · 0.85
TestEncodeDecode6Function · 0.85

Calls 7

oldFunction · 0.85
equalFunction · 0.85
DebugPrintMethod · 0.80
MarshalMethod · 0.65
UnmarshalMethod · 0.65
ResetMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…