mirror of
https://github.com/ETLCPP/etl.git
synced 2026-07-01 06:48:44 +08:00
Merge remote-tracking branch 'origin/development'
# Conflicts: # include/etl/version.h # support/Release notes.txt
This commit is contained in:
commit
c6203a0d1e
@ -1508,22 +1508,6 @@ namespace etl
|
||||
create_element_back(item);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Adds one to the front of the deque and returns a reference to the new element.
|
||||
/// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
|
||||
///\return A reference to the item to assign to.
|
||||
//*************************************************************************
|
||||
reference push_back()
|
||||
{
|
||||
reference r = *_end;
|
||||
#if defined(ETL_CHECK_PUSH_POP)
|
||||
ETL_ASSERT(!full(), ETL_ERROR(deque_full));
|
||||
#endif
|
||||
create_element_back();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Emplaces an item to the back of the deque.
|
||||
/// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
|
||||
@ -1616,21 +1600,6 @@ namespace etl
|
||||
create_element_front(item);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Adds one to the front of the deque and returns a reference to the new element.
|
||||
/// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
|
||||
///\return A reference to the item to assign to.
|
||||
//*************************************************************************
|
||||
reference push_front()
|
||||
{
|
||||
#if defined(ETL_CHECK_PUSH_POP)
|
||||
ETL_ASSERT(!full(), ETL_ERROR(deque_full));
|
||||
#endif
|
||||
create_element_front();
|
||||
|
||||
return *_begin;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Emplaces an item to the front of the deque.
|
||||
/// If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.
|
||||
|
||||
@ -626,14 +626,6 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Adds a node to the front of the forward_list so a new value can be assigned to front().
|
||||
//*************************************************************************
|
||||
void push_front()
|
||||
{
|
||||
push_front(T());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Pushes a value to the front of the forward_list.
|
||||
//*************************************************************************
|
||||
|
||||
@ -832,14 +832,6 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Adds a node to the front of the list so a new value can be assigned to front().
|
||||
//*************************************************************************
|
||||
void push_front()
|
||||
{
|
||||
push_front(T());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Pushes a value to the front of the list.
|
||||
//*************************************************************************
|
||||
@ -931,14 +923,6 @@ namespace etl
|
||||
remove_node(node);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Adds a node to the back of the list so a new value can be assigned to back().
|
||||
//*************************************************************************
|
||||
void push_back()
|
||||
{
|
||||
push_back(T());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Pushes a value to the back of the list..
|
||||
//*************************************************************************
|
||||
|
||||
@ -137,7 +137,6 @@ namespace etl
|
||||
|
||||
void clear();
|
||||
|
||||
void push_back();
|
||||
void push_back(value_type value);
|
||||
|
||||
void pop_back();
|
||||
|
||||
@ -316,25 +316,6 @@ namespace etl
|
||||
add_in();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Allows a possibly more efficient 'push' by moving to the next input value
|
||||
/// and returning a reference to it.
|
||||
/// This may eliminate a copy by allowing direct construction in-place.<br>
|
||||
/// If asserts or exceptions are enabled, throws an etl::queue_full is the queue is already full.
|
||||
/// \return A reference to the position to 'push' to.
|
||||
//*************************************************************************
|
||||
reference push()
|
||||
{
|
||||
const size_type next = in;
|
||||
|
||||
#if defined(ETL_CHECK_PUSH_POP)
|
||||
ETL_ASSERT(!full(), ETL_ERROR(queue_full));
|
||||
#endif
|
||||
add_in();
|
||||
|
||||
return p_buffer[next];
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Constructs a value in the queue 'in place'.
|
||||
/// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.
|
||||
|
||||
@ -322,23 +322,6 @@ namespace etl
|
||||
::new (&p_buffer[top_index]) T(value1, value2, value3, value4);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Allows a possibly more efficient 'push' by moving to the next input value
|
||||
/// and returning a reference to it.
|
||||
/// This may eliminate a copy by allowing direct construction in-place.<br>
|
||||
/// If asserts or exceptions are enabled, throws an etl::stack_full if the stack is already full.
|
||||
/// \return A reference to the position to 'push' to.
|
||||
//*************************************************************************
|
||||
reference push()
|
||||
{
|
||||
#if defined(ETL_CHECK_PUSH_POP)
|
||||
ETL_ASSERT(!full(), ETL_ERROR(stack_full));
|
||||
#endif
|
||||
base_t::add_in();
|
||||
|
||||
return p_buffer[top_index];
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Gets a const reference to the value at the top of the stack.<br>
|
||||
/// \return A const reference to the value at the top of the stack.
|
||||
|
||||
@ -397,19 +397,6 @@ namespace etl
|
||||
initialise();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Increases the size of the vector by one, but does not initialise the new element.
|
||||
/// If asserts or exceptions are enabled, throws a vector_full if the vector is already full.
|
||||
//*************************************************************************
|
||||
void push_back()
|
||||
{
|
||||
#if defined(ETL_CHECK_PUSH_POP)
|
||||
ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full));
|
||||
#endif
|
||||
|
||||
create_back();
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
/// Inserts a value at the end of the vector.
|
||||
/// If asserts or exceptions are enabled, emits vector_full if the vector is already full.
|
||||
|
||||
@ -37,12 +37,12 @@ SOFTWARE.
|
||||
/// Definitions of the ETL version
|
||||
///\ingroup utilities
|
||||
|
||||
#define ETL_VERSION "11.18.0"
|
||||
#define ETL_VERSION_W L"11.18.0"
|
||||
#define ETL_VERSION_U16 u"11.18.0"
|
||||
#define ETL_VERSION_U32 U"11.18.0"
|
||||
#define ETL_VERSION "11.19.0"
|
||||
#define ETL_VERSION_W L"11.19.0"
|
||||
#define ETL_VERSION_U16 u"11.19.0"
|
||||
#define ETL_VERSION_U32 U"11.19.0"
|
||||
#define ETL_VERSION_MAJOR 11
|
||||
#define ETL_VERSION_MINOR 18
|
||||
#define ETL_VERSION_MINOR 19
|
||||
#define ETL_VERSION_PATCH 0
|
||||
#define ETL_VERSION_VALUE ((ETL_VERSION_MAJOR * 10000) + (ETL_VERSION_MINOR * 100) + ETL_VERSION_PATCH)
|
||||
|
||||
|
||||
@ -298,19 +298,6 @@ void etl::pvoidvector::clear()
|
||||
initialise();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Increases the size of the vector by one, but does not initialise the new element.
|
||||
/// If asserts or exceptions are enabled, throws a vector_full if the vector is already full.
|
||||
//*************************************************************************
|
||||
void etl::pvoidvector::push_back()
|
||||
{
|
||||
#if defined(ETL_CHECK_PUSH_POP)
|
||||
ETL_ASSERT(size() != CAPACITY, ETL_ERROR(vector_full));
|
||||
#endif
|
||||
|
||||
++p_end;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
/// Inserts a value at the end of the vector.
|
||||
/// If asserts or exceptions are enabled, emits vector_full if the vector is already full.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
===============================================================================
|
||||
11.19.0
|
||||
Removed push(void) push_back(void) and push_front(void) function for containers.
|
||||
|
||||
===============================================================================
|
||||
11.18.0
|
||||
Added CRC16 MODBUS
|
||||
|
||||
@ -1214,35 +1214,6 @@ namespace
|
||||
CHECK_EQUAL(std::distance(compare_data.begin(), i_cnext), std::distance(data.begin(), i_next));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_back_null)
|
||||
{
|
||||
Compare_DataDC compare_data = { DC("1"), DC("2"), DC("3"), DC("4"), DC("5") };
|
||||
DataDC data;
|
||||
|
||||
CHECK_NO_THROW(data.push_back());
|
||||
CHECK_NO_THROW(data.back() = DC("1"));
|
||||
CHECK_EQUAL(size_t(1), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_back());
|
||||
CHECK_NO_THROW(data.back() = DC("2"));
|
||||
CHECK_EQUAL(size_t(2), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_back());
|
||||
CHECK_NO_THROW(data.back() = DC("3"));
|
||||
CHECK_EQUAL(size_t(3), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_back());
|
||||
CHECK_NO_THROW(data.back() = DC("4"));
|
||||
CHECK_EQUAL(size_t(4), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_back());
|
||||
CHECK_NO_THROW(data.back() = DC("5"));
|
||||
CHECK_EQUAL(size_t(5), data.size());
|
||||
|
||||
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_back)
|
||||
{
|
||||
@ -1355,35 +1326,6 @@ namespace
|
||||
CHECK_THROW(data.pop_back(), etl::deque_empty);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_front_null)
|
||||
{
|
||||
Compare_DataDC compare_data = { DC("5"), DC("4"), DC("3"), DC("2"), DC("1") };
|
||||
DataDC data;
|
||||
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
CHECK_NO_THROW(data.front() = DC("1"));
|
||||
CHECK_EQUAL(size_t(1), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
CHECK_NO_THROW(data.front() = DC("2"));
|
||||
CHECK_EQUAL(size_t(2), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
CHECK_NO_THROW(data.front() = DC("3"));
|
||||
CHECK_EQUAL(size_t(3), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
CHECK_NO_THROW(data.front() = DC("4"));
|
||||
CHECK_EQUAL(size_t(4), data.size());
|
||||
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
CHECK_NO_THROW(data.front() = DC("5"));
|
||||
CHECK_EQUAL(size_t(5), data.size());
|
||||
|
||||
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_front)
|
||||
{
|
||||
|
||||
@ -573,40 +573,6 @@ namespace
|
||||
CHECK(are_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_front_null)
|
||||
{
|
||||
CompareDataDC compare_data;
|
||||
DataDC data;
|
||||
|
||||
compare_data.push_front(ItemDC("1"));
|
||||
compare_data.push_front(ItemDC("2"));
|
||||
compare_data.push_front(ItemDC("3"));
|
||||
compare_data.push_front(ItemDC("4"));
|
||||
compare_data.push_front(ItemDC("5"));
|
||||
compare_data.push_front(ItemDC("6"));
|
||||
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
data.front() = ItemDC("1");
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
data.front() = ItemDC("2");
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
data.front() = ItemDC("3");
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
data.front() = ItemDC("4");
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
data.front() = ItemDC("5");
|
||||
CHECK_NO_THROW(data.push_front());
|
||||
data.front() = ItemDC("6");
|
||||
|
||||
CHECK_EQUAL(6U, data.size());
|
||||
CHECK_EQUAL(6, std::distance(data.begin(), data.end()));
|
||||
|
||||
are_equal = std::equal(data.begin(), data.end(), compare_data.begin());
|
||||
|
||||
CHECK(are_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_front_const)
|
||||
{
|
||||
|
||||
@ -272,23 +272,6 @@ namespace
|
||||
CHECK_EQUAL(2, queue.front());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_void)
|
||||
{
|
||||
etl::queue<int, 4> queue;
|
||||
|
||||
queue.push() = 1;
|
||||
CHECK_EQUAL(1U, queue.size());
|
||||
|
||||
queue.push() = 2;
|
||||
CHECK_EQUAL(2U, queue.size());
|
||||
|
||||
CHECK_EQUAL(1, queue.front());
|
||||
|
||||
queue.pop();
|
||||
CHECK_EQUAL(2, queue.front());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_excess)
|
||||
{
|
||||
@ -355,39 +338,6 @@ namespace
|
||||
queue.pop();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_multiple_push_void)
|
||||
{
|
||||
etl::queue<int, 4> queue;
|
||||
|
||||
queue.push() = 1;
|
||||
queue.push() = 2;
|
||||
queue.push() = 3;
|
||||
|
||||
bool pass = true;
|
||||
|
||||
if (queue.front() != 1)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
queue.pop();
|
||||
|
||||
if (queue.front() != 2)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
queue.pop();
|
||||
|
||||
if (queue.front() != 3)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
CHECK(pass);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_pop)
|
||||
{
|
||||
|
||||
@ -293,23 +293,6 @@ namespace
|
||||
CHECK_EQUAL(255U, queue.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_void)
|
||||
{
|
||||
QueueInt queue;
|
||||
|
||||
queue.push() = 1;
|
||||
CHECK_EQUAL(1U, queue.size());
|
||||
|
||||
queue.push() = 2;
|
||||
CHECK_EQUAL(2U, queue.size());
|
||||
|
||||
CHECK_EQUAL(1, queue.front());
|
||||
|
||||
queue.pop();
|
||||
CHECK_EQUAL(2, queue.front());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_excess)
|
||||
{
|
||||
@ -376,39 +359,6 @@ namespace
|
||||
queue.pop();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_multiple_push_void)
|
||||
{
|
||||
QueueInt queue;
|
||||
|
||||
queue.push() = 1;
|
||||
queue.push() = 2;
|
||||
queue.push() = 3;
|
||||
|
||||
bool pass = true;
|
||||
|
||||
if (queue.front() != 1)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
queue.pop();
|
||||
|
||||
if (queue.front() != 2)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
queue.pop();
|
||||
|
||||
if (queue.front() != 3)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
CHECK(pass);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_pop)
|
||||
{
|
||||
|
||||
@ -242,23 +242,6 @@ namespace
|
||||
CHECK(stack.top() == Item('a', 1, 1.2));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_void)
|
||||
{
|
||||
etl::stack<int, 4> stack;
|
||||
|
||||
stack.push() = 1;
|
||||
CHECK_EQUAL(1U, stack.size());
|
||||
|
||||
stack.push() = 2;
|
||||
CHECK_EQUAL(2U, stack.size());
|
||||
|
||||
CHECK_EQUAL(2, stack.top());
|
||||
|
||||
stack.pop();
|
||||
CHECK_EQUAL(1, stack.top());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_push_excess)
|
||||
{
|
||||
@ -442,39 +425,6 @@ namespace
|
||||
CHECK(pass);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_multiple_push_void)
|
||||
{
|
||||
etl::stack<int, 4> stack;
|
||||
|
||||
stack.push() = 1;
|
||||
stack.push() = 2;
|
||||
stack.push() = 3;
|
||||
|
||||
bool pass = true;
|
||||
|
||||
if (stack.top() != 3)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
stack.pop();
|
||||
|
||||
if (stack.top() != 2)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
stack.pop();
|
||||
|
||||
if (stack.top() != 1)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
|
||||
CHECK(pass);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_assignment)
|
||||
{
|
||||
|
||||
@ -514,26 +514,6 @@ namespace
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_back_null)
|
||||
{
|
||||
Compare_Data compare_data;
|
||||
Data data;
|
||||
|
||||
compare_data.push_back(1);
|
||||
|
||||
data.push_back();
|
||||
data[0] = 1;
|
||||
|
||||
CHECK_EQUAL(compare_data.size(), data.size());
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
compare_data.begin());
|
||||
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_back_excess)
|
||||
{
|
||||
|
||||
@ -533,26 +533,6 @@ namespace
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_back_null)
|
||||
{
|
||||
CompareDataDC compare_data;
|
||||
DataDC data;
|
||||
|
||||
compare_data.push_back(DC("1"));
|
||||
|
||||
data.push_back();
|
||||
data[0] = DC("1");
|
||||
|
||||
CHECK_EQUAL(compare_data.size(), data.size());
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
compare_data.begin());
|
||||
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_back_excess)
|
||||
{
|
||||
|
||||
@ -935,42 +935,6 @@ namespace
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_back_null)
|
||||
{
|
||||
Compare_Data compare_data;
|
||||
Data data;
|
||||
|
||||
int d;
|
||||
|
||||
compare_data.push_back(&d);
|
||||
|
||||
data.push_back();
|
||||
data[0] = &d;
|
||||
|
||||
bool is_equal = std::equal(data.begin(), data.end(), compare_data.begin());
|
||||
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_const_push_back_null)
|
||||
{
|
||||
CCompare_Data compare_data;
|
||||
CData data;
|
||||
|
||||
const int d = 0;
|
||||
|
||||
compare_data.push_back(&d);
|
||||
|
||||
data.push_back();
|
||||
data[0] = &d;
|
||||
|
||||
bool is_equal = std::equal(data.begin(), data.end(), compare_data.begin());
|
||||
|
||||
CHECK(is_equal);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_push_back_excess)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user