Skip to content

Commit 862faf7

Browse files
Fixes in tests based on Code Analysis in Visual Studio
1 parent 5184652 commit 862faf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,7 @@ static void TestGPUUploadHeap(const TestContext& ctx)
29712971
res->Unmap(0, NULL); // NULL - written everything.
29722972

29732973
CHECK_HR(res->Map(0, NULL, (void**)&mappedData)); // NULL - reading everything.
2974-
CHECK_BOOL(mappedData[100] = 300);
2974+
CHECK_BOOL(mappedData[100] == 300);
29752975
res->Unmap(0, &EMPTY_RANGE); // {0, 0} - not written anything.
29762976

29772977
}
@@ -3344,7 +3344,7 @@ static void TestVirtualBlocksAlgorithmsBenchmark(const TestContext& ctx)
33443344

33453345
RandomNumberGenerator rand{ 20092010 };
33463346

3347-
UINT32 allocSizes[ALLOCATION_COUNT];
3347+
std::vector<UINT32> allocSizes(ALLOCATION_COUNT);
33483348
for (size_t i = 0; i < ALLOCATION_COUNT; ++i)
33493349
{
33503350
allocSizes[i] = rand.Generate() % MAX_ALLOC_SIZE + 1;
@@ -3379,7 +3379,7 @@ static void TestVirtualBlocksAlgorithmsBenchmark(const TestContext& ctx)
33793379
assert(0);
33803380
}
33813381

3382-
D3D12MA::VirtualAllocation allocs[ALLOCATION_COUNT];
3382+
std::vector <D3D12MA::VirtualAllocation> allocs(ALLOCATION_COUNT);
33833383
ComPtr<D3D12MA::VirtualBlock> block;
33843384
CHECK_HR(D3D12MA::CreateVirtualBlock(&blockDesc, &block));
33853385
duration allocDuration = duration::zero();
@@ -3393,7 +3393,7 @@ static void TestVirtualBlocksAlgorithmsBenchmark(const TestContext& ctx)
33933393
allocSizes[i],
33943394
alignment };
33953395

3396-
CHECK_HR(block->Allocate(&allocCreateInfo, allocs + i, nullptr));
3396+
CHECK_HR(block->Allocate(&allocCreateInfo, &allocs[i], nullptr));
33973397
}
33983398
allocDuration += std::chrono::high_resolution_clock::now() - timeBegin;
33993399

0 commit comments

Comments
 (0)