Skip to content

Commit 7392863

Browse files
committed
limayaml/defaults_test.go: fix incorrect expect.Mounts[0].Virtiofs.QueueSize
`expect.Mounts[0]` was the same instance as each of `y.Mounts[0]` and `d.Mounts[0]`, so the test passed regardless of the value set for `Virtiofs.QueueSize`. The default for `Virtiofs.QueueSize` is `nil`, but I'll keep the code that explicitly sets it to `nil` to make it clear that `nil` is expected. Signed-off-by: Norio Nomura <[email protected]>
1 parent d05e159 commit 7392863

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/limayaml/defaults_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func TestFillDefault(t *testing.T) {
212212
expect.Mounts[0].NineP.ProtocolVersion = ptr.Of(Default9pProtocolVersion)
213213
expect.Mounts[0].NineP.Msize = ptr.Of(Default9pMsize)
214214
expect.Mounts[0].NineP.Cache = ptr.Of(Default9pCacheForRO)
215-
expect.Mounts[0].Virtiofs.QueueSize = ptr.Of(DefaultVirtiofsQueueSize)
215+
expect.Mounts[0].Virtiofs.QueueSize = nil
216216
// Only missing Mounts field is Writable, and the default value is also the null value: false
217217

218218
expect.MountType = ptr.Of(NINEP)
@@ -423,7 +423,7 @@ func TestFillDefault(t *testing.T) {
423423
expect.Mounts[0].NineP.ProtocolVersion = ptr.Of(Default9pProtocolVersion)
424424
expect.Mounts[0].NineP.Msize = ptr.Of(Default9pMsize)
425425
expect.Mounts[0].NineP.Cache = ptr.Of(Default9pCacheForRO)
426-
expect.Mounts[0].Virtiofs.QueueSize = ptr.Of(DefaultVirtiofsQueueSize)
426+
expect.Mounts[0].Virtiofs.QueueSize = nil
427427
expect.HostResolver.Hosts = map[string]string{
428428
"default": d.HostResolver.Hosts["default"],
429429
}

0 commit comments

Comments
 (0)