diff options
author | Ian Gudger <igudger@google.com> | 2018-05-08 09:38:55 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-05-08 09:39:42 -0700 |
commit | d0d01a18963ed7cfc29e5b8334e30b1234b6048b (patch) | |
tree | a26908a857735ece8e6b5a2daf5632a1fa0f9c36 | |
parent | 7c8c3705ea5d891a3d6126090b1f49d8bae44177 (diff) |
Fix format string type in test
PiperOrigin-RevId: 195831778
Change-Id: I413dc909cedc18fbf5320a4f75d876f1be133c6c
-rw-r--r-- | pkg/sentry/kernel/fd_map_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/sentry/kernel/fd_map_test.go b/pkg/sentry/kernel/fd_map_test.go index e1ac900e8..95123aef3 100644 --- a/pkg/sentry/kernel/fd_map_test.go +++ b/pkg/sentry/kernel/fd_map_test.go @@ -119,16 +119,18 @@ func TestDescriptorFlags(t *testing.T) { limitSet := limits.NewLimitSet() limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}) - if err := f.NewFDAt(2, file, FDFlags{CloseOnExec: true}, limitSet); err != nil { + origFlags := FDFlags{CloseOnExec: true} + + if err := f.NewFDAt(2, file, origFlags, limitSet); err != nil { t.Fatalf("f.NewFDAt(2, r, FDFlags{}): got %v, wanted nil", err) } - newFile, flags := f.GetDescriptor(2) + newFile, newFlags := f.GetDescriptor(2) if newFile == nil { t.Fatalf("f.GetFile(2): got a %v, wanted nil", newFile) } - if !flags.CloseOnExec { - t.Fatalf("new File flags %d don't match original %d\n", flags, 0) + if newFlags != origFlags { + t.Fatalf("new File flags %+v don't match original %+v", newFlags, origFlags) } } |