Skip to content

Commit 0b5279f

Browse files
committed
Merge #8166: src/test: Do not shadow local variables
c2715d3 Do not shadow local variables (Pavel Janík)
2 parents 1445835 + c2715d3 commit 0b5279f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/test/base58_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class TestAddrTypeVisitor : public boost::static_visitor<bool>
7979
private:
8080
std::string exp_addrType;
8181
public:
82-
TestAddrTypeVisitor(const std::string &exp_addrType) : exp_addrType(exp_addrType) { }
82+
TestAddrTypeVisitor(const std::string &_exp_addrType) : exp_addrType(_exp_addrType) { }
8383
bool operator()(const CKeyID &id) const
8484
{
8585
return (exp_addrType == "pubkey");
@@ -100,7 +100,7 @@ class TestPayloadVisitor : public boost::static_visitor<bool>
100100
private:
101101
std::vector<unsigned char> exp_payload;
102102
public:
103-
TestPayloadVisitor(std::vector<unsigned char> &exp_payload) : exp_payload(exp_payload) { }
103+
TestPayloadVisitor(std::vector<unsigned char> &_exp_payload) : exp_payload(_exp_payload) { }
104104
bool operator()(const CKeyID &id) const
105105
{
106106
uint160 exp_key(exp_payload);

src/test/miner_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
385385
SetMockTime(0);
386386
mempool.clear();
387387

388-
BOOST_FOREACH(CTransaction *tx, txFirst)
389-
delete tx;
388+
BOOST_FOREACH(CTransaction *_tx, txFirst)
389+
delete _tx;
390390

391391
fCheckpointsEnabled = true;
392392
}

src/test/pmt_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ BOOST_AUTO_TEST_CASE(pmt_test1)
3737
seed_insecure_rand(false);
3838
static const unsigned int nTxCounts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095};
3939

40-
for (int n = 0; n < 12; n++) {
41-
unsigned int nTx = nTxCounts[n];
40+
for (int i = 0; i < 12; i++) {
41+
unsigned int nTx = nTxCounts[i];
4242

4343
// build a block with some dummy transactions
4444
CBlock block;

src/test/prevector_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ BOOST_AUTO_TEST_CASE(PrevectorTestInt)
192192
if (((r >> 21) % 32) == 7) {
193193
int values[4];
194194
int num = 1 + (insecure_rand() % 4);
195-
for (int i = 0; i < num; i++) {
196-
values[i] = insecure_rand();
195+
for (int k = 0; k < num; k++) {
196+
values[k] = insecure_rand();
197197
}
198198
test.insert_range(insecure_rand() % (test.size() + 1), values, values + num);
199199
}

0 commit comments

Comments
 (0)