From d0d01a18963ed7cfc29e5b8334e30b1234b6048b Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Tue, 8 May 2018 09:38:55 -0700 Subject: Fix format string type in test PiperOrigin-RevId: 195831778 Change-Id: I413dc909cedc18fbf5320a4f75d876f1be133c6c --- pkg/sentry/kernel/fd_map_test.go | 10 ++++++---- 1 file 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) } } -- cgit v1.2.3