MCPcopy Create free account
hub / github.com/google/gapid / TestBoxMemoryType

Function TestBoxMemoryType

gapis/service/box/box_test.go:335–365  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

333}
334
335func TestBoxMemoryType(t *testing.T) {
336 ctx := log.Testing(t)
337 ty := box.NewType(reflect.TypeOf(Memory{}))
338 got, _ := json.MarshalIndent(ty, "", " ")
339 expect := `{
340 "type_id": 1,
341 "Ty": {
342 "Struct": {
343 "fields": [
344 {
345 "type": {
346 "Ty": {
347 "Pointer": true
348 }
349 },
350 "name": "P"
351 },
352 {
353 "type": {
354 "Ty": {
355 "Slice": true
356 }
357 },
358 "name": "S"
359 }
360 ]
361 }
362 }
363}`
364 assert.For(ctx, "NewType(Struct)").ThatString(got).Equals(expect)
365}
366
367func TestBoxUnboxMemory(t *testing.T) {
368 ctx := log.Testing(t)

Callers

nothing calls this directly

Calls 4

ThatStringMethod · 0.80
ForMethod · 0.80
EqualsMethod · 0.65
TypeOfMethod · 0.45

Tested by

no test coverage detected