diff options
author | Ting-Yu Wang <anivia@google.com> | 2020-08-20 15:38:06 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-20 15:40:15 -0700 |
commit | df4822709992c971af0f9b339d915f6e629c0225 (patch) | |
tree | c84266b3c69cf6b975f9517ed7061863e464a82d /pkg/state/tests/load_test.go | |
parent | 3163aff866852e730777be4ef689b0405c6332cd (diff) |
stateify: Fix afterLoad not being called for root object
PiperOrigin-RevId: 327711264
Diffstat (limited to 'pkg/state/tests/load_test.go')
-rw-r--r-- | pkg/state/tests/load_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/state/tests/load_test.go b/pkg/state/tests/load_test.go index 1e9794296..3c73ac391 100644 --- a/pkg/state/tests/load_test.go +++ b/pkg/state/tests/load_test.go @@ -20,6 +20,14 @@ import ( func TestLoadHooks(t *testing.T) { runTestCases(t, false, "load-hooks", []interface{}{ + // Root object being a struct. + afterLoadStruct{v: 1}, + valueLoadStruct{v: 1}, + genericContainer{v: &afterLoadStruct{v: 1}}, + genericContainer{v: &valueLoadStruct{v: 1}}, + sliceContainer{v: []interface{}{&afterLoadStruct{v: 1}}}, + sliceContainer{v: []interface{}{&valueLoadStruct{v: 1}}}, + // Root object being a pointer. &afterLoadStruct{v: 1}, &valueLoadStruct{v: 1}, &genericContainer{v: &afterLoadStruct{v: 1}}, |