Skip to content

Commit 5b297ba

Browse files
test: zero-initialize states in test's body
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
1 parent 7d3fc9a commit 5b297ba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
445445
uint32_t dims[] = {2, 1, 1};
446446
uint32_t numBindingTable = 1;
447447
uint32_t numSamplers = 1;
448-
SAMPLER_STATE samplerState;
449-
BINDING_TABLE_STATE bindingTable;
448+
SAMPLER_STATE samplerState{};
449+
BINDING_TABLE_STATE bindingTable{};
450450
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
451451

452452
dispatchInterface->kernelDescriptor.payloadMappings.bindingTable.numEntries = numBindingTable;

shared/test/unit_test/encoders/test_encode_states.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ HWTEST_F(CommandEncodeStatesTest, GivenCommandStreamWhenEncodeCopySamplerStateTh
3030
}
3131
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
3232
uint32_t numSamplers = 1;
33-
SAMPLER_STATE samplerState;
33+
SAMPLER_STATE samplerState{};
3434

3535
auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE);
3636
auto usedBefore = dsh->getUsed();
@@ -440,4 +440,4 @@ HWTEST2_F(CommandEncodeStatesTest, whenGetCmdSizeForComputeModeThenCorrectValueI
440440
auto &csr = deviceFactory.rootDevices[0]->getUltCommandStreamReceiver<FamilyType>();
441441
csr.streamProperties.stateComputeMode.setProperties(false, 0, ThreadArbitrationPolicy::AgeBased, *defaultHwInfo);
442442
EXPECT_EQ(expectedScmSize, csr.getCmdSizeForComputeMode());
443-
}
443+
}

0 commit comments

Comments
 (0)