summaryrefslogtreecommitdiff
path: root/test/unit/context
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2020-03-09 11:47:03 -0700
committerAina Niemetz <aina.niemetz@gmail.com>2020-03-10 11:20:30 -0700
commit065a565ef6c1aa235fab7fc9e735c156ed2d3694 (patch)
tree9c163f39a3e96c179f82aae81dc4d585c6078926 /test/unit/context
parentc8e4f878b88df43e3b231f571b32cef5cf8d5004 (diff)
Fix -Wshadow warning in test/unit/context/context_mm_black. (#3985)
Diffstat (limited to 'test/unit/context')
-rw-r--r--test/unit/context/context_mm_black.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/unit/context/context_mm_black.h b/test/unit/context/context_mm_black.h
index cd5ff8242..67c653c37 100644
--- a/test/unit/context/context_mm_black.h
+++ b/test/unit/context/context_mm_black.h
@@ -46,11 +46,15 @@ private:
unsigned chunkSizeBytes = 16384;
unsigned maxFreeChunks = 100;
unsigned piecesPerChunk = 13;
- unsigned len = chunkSizeBytes / piecesPerChunk; // Length of the individual block
- unsigned N = maxFreeChunks*piecesPerChunk;
+ unsigned len;
+ unsigned N;
+
+ len = chunkSizeBytes / piecesPerChunk; // Length of the individual block
+ N = maxFreeChunks * piecesPerChunk;
for(unsigned p = 0; p < 5; ++ p) {
d_cmm->push();
- for(unsigned i = 0; i < N; ++i) {
+ for (unsigned 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
@@ -70,17 +74,19 @@ private:
unsigned factor = 3;
N = 16384 / factor;
-
// Push, then allocate, then pop all at once
- for(unsigned p = 0; p < 5; ++ p) {
+ for (unsigned p = 0; p < 5; ++p)
+ {
d_cmm->push();
- for(unsigned i = 1; i < N; ++i) {
- unsigned len = i * factor;
+ for (unsigned i = 1; i < N; ++i)
+ {
+ len = i * factor;
char* newMem = (char*)d_cmm->newData(len);
- for(unsigned k = 0; k < len - 1; k ++) {
+ for (unsigned k = 0; k < len - 1; k++)
+ {
newMem[k] = 'a';
}
- newMem[len-1] = 0;
+ newMem[len - 1] = 0;
TS_ASSERT(strlen(newMem) == len - 1);
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback