gvisor/pkg/state/tests
Jamie Liu 227fd9f1b0 //pkg/state fixes for VFS2.
- When encodeState.resolve() determines that the resolved reflect.Value is
  contained by a previously-resolved object, set wire.Ref.Type to the
  containing object's type (existing.obj.Type()) rather than the contained
  value's type (obj.Type()).

- When encodeState.resolve() determines that the resolved reflect.Value
  contains a previously-resolved object, handle cases where the new object
  contains *multiple* previously-resolved objects. (This may cause
  previously-allocated object IDs to become unused; to facilitate this, change
  encodeState.pending to a map, and change the wire format to prefix each
  object with its object ID.)

- Add encodeState.encodedStructs to avoid redundant encoding of structs, since
  deduplication of objects via encodeState.resolve() doesn't work for objects
  instantiated by StateSave() and passed to SaveValue() (i.e. fields tagged
  `state:".(whatever)"`).

- Make unexported array fields deserializable via slices that refer to them by
  casting away their unexportedness in decodeState.decodeObject().

Updates #1663

PiperOrigin-RevId: 338727687
2020-10-23 12:53:20 -07:00
..
BUILD Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
array.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
array_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
bench.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
bench_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
bool_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
float_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
integer.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
integer_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
load.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
load_test.go stateify: Fix afterLoad not being called for root object 2020-08-20 15:40:15 -07:00
map.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
map_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
register.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
register_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
string_test.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00
struct.go //pkg/state fixes for VFS2. 2020-10-23 12:53:20 -07:00
struct_test.go //pkg/state fixes for VFS2. 2020-10-23 12:53:20 -07:00
tests.go Support for saving pointers to fields in the state package. 2020-06-23 23:34:06 -07:00