diff options
Diffstat (limited to 'src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp')
| -rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp index 09692bfb..520ed426 100644 --- a/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp | |||
| @@ -23,7 +23,7 @@ namespace DutilTests | |||
| 23 | void MemUtilAppendTest() | 23 | void MemUtilAppendTest() |
| 24 | { | 24 | { |
| 25 | HRESULT hr = S_OK; | 25 | HRESULT hr = S_OK; |
| 26 | DWORD dwSize; | 26 | SIZE_T cbSize = 0; |
| 27 | ArrayValue *rgValues = NULL; | 27 | ArrayValue *rgValues = NULL; |
| 28 | DWORD cValues = 0; | 28 | DWORD cValues = 0; |
| 29 | 29 | ||
| @@ -65,8 +65,11 @@ namespace DutilTests | |||
| 65 | // and make sure it doesn't grow since we already have enough space | 65 | // and make sure it doesn't grow since we already have enough space |
| 66 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&rgValues), cValues, sizeof(ArrayValue), 5); | 66 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&rgValues), cValues, sizeof(ArrayValue), 5); |
| 67 | NativeAssert::Succeeded(hr, "Failed to ensure array size matches what it should already be"); | 67 | NativeAssert::Succeeded(hr, "Failed to ensure array size matches what it should already be"); |
| 68 | dwSize = MemSize(rgValues); | 68 | |
| 69 | if (dwSize != 6 * sizeof(ArrayValue)) | 69 | hr = MemSizeChecked(rgValues, &cbSize); |
| 70 | NativeAssert::Succeeded(hr, "Failed to get current array size"); | ||
| 71 | |||
| 72 | if (cbSize != 6 * sizeof(ArrayValue)) | ||
| 70 | { | 73 | { |
| 71 | hr = E_FAIL; | 74 | hr = E_FAIL; |
| 72 | ExitOnFailure(hr, "MemEnsureArraySize is growing an array that is already big enough!"); | 75 | ExitOnFailure(hr, "MemEnsureArraySize is growing an array that is already big enough!"); |
