diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2020-03-10 09:47:36 -0700 |
---|---|---|
committer | Aina Niemetz <aina.niemetz@gmail.com> | 2020-03-10 11:20:30 -0700 |
commit | bc85357bf3a0973093867b50d1247e6e1bb3273a (patch) | |
tree | c96329155101858e09b9078f24e857ff12c2c3d9 /test/unit | |
parent | 065a565ef6c1aa235fab7fc9e735c156ed2d3694 (diff) |
Use fixed-width types in test/unit/context/contest_mm_black. (#3985)
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/context/context_mm_black.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/test/unit/context/context_mm_black.h b/test/unit/context/context_mm_black.h index 67c653c37..1e2d5bb0b 100644 --- a/test/unit/context/context_mm_black.h +++ b/test/unit/context/context_mm_black.h @@ -43,23 +43,25 @@ private: // Push, then allocate, then pop // We make sure that we don't allocate too much so that all the regions // should be reclaimed - unsigned chunkSizeBytes = 16384; - unsigned maxFreeChunks = 100; - unsigned piecesPerChunk = 13; - unsigned len; - unsigned N; + uint32_t chunkSizeBytes = 16384; + uint32_t maxFreeChunks = 100; + uint32_t piecesPerChunk = 13; + uint32_t len; + uint32_t N; len = chunkSizeBytes / piecesPerChunk; // Length of the individual block N = maxFreeChunks * piecesPerChunk; - for(unsigned p = 0; p < 5; ++ p) { + for (uint32_t p = 0; p < 5; ++p) + { d_cmm->push(); - for (unsigned i = 0; i < N; ++i) + for (uint32_t i = 0; i < N; ++i) { char* newMem = (char*)d_cmm->newData(len); // We only setup the memory in the first run, the others should // reclaim the same memory if(p == 0) { - for(unsigned k = 0; k < len - 1; k ++) { + for (uint32_t k = 0; k < len - 1; k++) + { newMem[k] = 'a'; } newMem[len-1] = 0; @@ -72,17 +74,17 @@ private: d_cmm->pop(); } - unsigned factor = 3; + uint32_t factor = 3; N = 16384 / factor; // Push, then allocate, then pop all at once - for (unsigned p = 0; p < 5; ++p) + for (uint32_t p = 0; p < 5; ++p) { d_cmm->push(); - for (unsigned i = 1; i < N; ++i) + for (uint32_t i = 1; i < N; ++i) { len = i * factor; char* newMem = (char*)d_cmm->newData(len); - for (unsigned k = 0; k < len - 1; k++) + for (uint32_t k = 0; k < len - 1; k++) { newMem[k] = 'a'; } @@ -90,7 +92,8 @@ private: TS_ASSERT(strlen(newMem) == len - 1); } } - for(unsigned p = 0; p < 5; ++ p) { + for (uint32_t p = 0; p < 5; ++p) + { d_cmm->pop(); } |