Skip to content

Commit

Permalink
Changed shadowed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Mar 5, 2024
1 parent de6e6ab commit 131ed46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
12 changes: 6 additions & 6 deletions include/etl/deque.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,19 +352,19 @@ namespace etl
}

//***************************************************
reference operator [](size_t index)
reference operator [](size_t i)
{
iterator result(*this);
result += index;
result += i;

return *result;
}

//***************************************************
const_reference operator [](size_t index) const
const_reference operator [](size_t i) const
{
iterator result(*this);
result += index;
result += i;

return *result;
}
Expand Down Expand Up @@ -622,10 +622,10 @@ namespace etl
}

//***************************************************
reference operator [](size_t index)
reference operator [](size_t i)
{
iterator result(*this);
result += index;
result += i;

return *result;
}
Expand Down
22 changes: 4 additions & 18 deletions test/test_deque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,11 @@ namespace
//*************************************************************************
TEST(test_constructor_fill)
{
//Compare_Data compare_data(SIZE, N999);
//DataNDC data(SIZE, N999);
Compare_Data compare_data(SIZE, N999);
DataNDC data(SIZE, N999);

etl::deque<int, 10> data;
using iter_type = etl::deque<int, 10>::iterator;

bool b1 = std::random_access_iterator<iter_type>;

bool b2 = std::sentinel_for<iter_type, iter_type>;

//bool b = std::equal(data.begin(), data.end(), data.begin());

//CHECK_EQUAL(compare_data.size(), data.size());
//CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}

//*************************************************************************
Expand Down Expand Up @@ -177,7 +168,6 @@ namespace
//*************************************************************************
TEST(test_move_constructor)
{
const size_t SIZE = 10UL;
typedef etl::deque<std::unique_ptr<uint32_t>, SIZE> Data;

std::unique_ptr<uint32_t> p1(new uint32_t(1U));
Expand Down Expand Up @@ -206,7 +196,6 @@ namespace
//*************************************************************************
TEST(test_move_insert_erase)
{
const size_t SIZE = 10UL;
typedef etl::deque<std::unique_ptr<uint32_t>, SIZE> Data;

std::unique_ptr<uint32_t> p1(new uint32_t(1U));
Expand Down Expand Up @@ -259,7 +248,6 @@ namespace
//*************************************************************************
TEST(test_move_assignment)
{
const size_t SIZE = 10UL;
typedef etl::deque<std::unique_ptr<uint32_t>, SIZE> Data;

std::unique_ptr<uint32_t> p1(new uint32_t(1U));
Expand Down Expand Up @@ -304,7 +292,6 @@ namespace
//*************************************************************************
TEST(test_move_assignment_interface)
{
const size_t SIZE = 10UL;
typedef etl::deque<std::unique_ptr<uint32_t>, SIZE> Data;
typedef etl::ideque<std::unique_ptr<uint32_t>> IData;

Expand Down Expand Up @@ -2148,7 +2135,6 @@ namespace
//*************************************************************************
TEST(test_move)
{
const size_t SIZE = 10UL;
typedef etl::deque<std::unique_ptr<uint32_t>, SIZE> Data;

Data data1;
Expand Down

0 comments on commit 131ed46

Please sign in to comment.