mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Compatibility changes for GCC v5.4.
This commit is contained in:
parent
0d25c49e00
commit
6efad78028
@ -33,7 +33,7 @@ SOFTWARE.
|
||||
|
||||
///\ingroup private
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "../platform.h"
|
||||
#include "../absolute.h"
|
||||
@ -234,9 +234,9 @@ namespace etl
|
||||
|
||||
iterator start = str.end();
|
||||
|
||||
if (isnan(value) || isinf(value))
|
||||
if (std::isnan(value) || std::isinf(value))
|
||||
{
|
||||
etl::private_to_string::add_nan_inf(isnan(value), isinf(value), str);
|
||||
etl::private_to_string::add_nan_inf(std::isnan(value), std::isinf(value), str);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -39,8 +39,6 @@ SOFTWARE.
|
||||
#include "format_spec.h"
|
||||
#include "private/to_string_helper.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
|
||||
@ -39,7 +39,7 @@ SOFTWARE.
|
||||
|
||||
#define ETL_VERSION_MAJOR 14
|
||||
#define ETL_VERSION_MINOR 26
|
||||
#define ETL_VERSION_PATCH 6
|
||||
#define ETL_VERSION_PATCH 7
|
||||
|
||||
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH)
|
||||
#define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH))
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
===============================================================================
|
||||
14.26.7
|
||||
Compatibility changes for GCC v5.4.
|
||||
|
||||
===============================================================================
|
||||
14.26.6
|
||||
Added variadic parameters to observer notification.
|
||||
|
||||
@ -18,7 +18,8 @@ else()
|
||||
# Therefore we update the provide UTPP_INCLUDE_DIRS here
|
||||
set(UTPP_INCLUDE_DIRS "${UTPP_INCLUDE_DIRS}/UnitTest++")
|
||||
endif()
|
||||
include_directories(${UTPP_INCLUDE_DIRS})
|
||||
|
||||
include_directories(${UTPP_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/../include)
|
||||
|
||||
set(TEST_SOURCE_FILES
|
||||
main.cpp
|
||||
@ -117,6 +118,38 @@ set(TEST_SOURCE_FILES
|
||||
test_visitor.cpp
|
||||
test_xor_checksum.cpp
|
||||
test_xor_rotate_checksum.cpp
|
||||
test_atomic_std.cpp
|
||||
test_callback_service.cpp
|
||||
test_cumulative_moving_average.cpp
|
||||
test_delegate.cpp
|
||||
test_delegate_service.cpp
|
||||
test_forward_list_shared_pool.cpp
|
||||
test_list_shared_pool.cpp
|
||||
test_multi_array.cpp
|
||||
test_no_stl_algorithm.cpp
|
||||
test_no_stl_functional.cpp
|
||||
test_no_stl_iterator.cpp
|
||||
test_no_stl_limits.cpp
|
||||
test_no_stl_utility.cpp
|
||||
test_queue_memory_model_small.cpp
|
||||
test_queue_mpmc_mutex.cpp
|
||||
test_queue_mpmc_mutex_small.cpp
|
||||
test_queue_spsc_atomic.cpp
|
||||
test_queue_spsc_atomic_small.cpp
|
||||
test_queue_spsc_isr.cpp
|
||||
test_queue_spsc_isr_small.cpp
|
||||
test_queue_spsc_locked.cpp
|
||||
test_queue_spsc_locked_small.cpp
|
||||
test_scaled_rounding.cpp
|
||||
test_state_chart.cpp
|
||||
test_string_view.cpp
|
||||
test_to_string.cpp
|
||||
test_to_u16string.cpp
|
||||
test_to_u32string.cpp
|
||||
test_to_wstring.cpp
|
||||
test_type_select.cpp
|
||||
test_vector_external_buffer.cpp
|
||||
test_vector_pointer_external_buffer.cpp
|
||||
|
||||
# Compile the source level ecl_timer here as test has provided a ecl_user.h file
|
||||
${PROJECT_SOURCE_DIR}/../src/c/ecl_timer.c
|
||||
@ -132,7 +165,6 @@ if (WIN32)
|
||||
ADD_DEFINITIONS(-D_UNICODE)
|
||||
endif()
|
||||
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
list(APPEND TEST_SOURCE_FILES "test_atomic_gcc_sync.cpp")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
||||
@ -140,7 +172,8 @@ endif()
|
||||
add_executable(etl_tests
|
||||
${TEST_SOURCE_FILES}
|
||||
)
|
||||
target_link_libraries(etl_tests etl UnitTest++)
|
||||
#target_link_libraries(etl_tests etl UnitTest++)
|
||||
target_link_libraries(etl_tests UnitTest++)
|
||||
target_include_directories(etl_tests
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
@ -155,6 +188,6 @@ add_test(etl_unit_tests etl_tests)
|
||||
add_custom_target(test_verbose COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
|
||||
|
||||
|
||||
# Remaining Tests to be implemented:
|
||||
#1. Enable embedded compile target testing
|
||||
# - test_embedded_compile.cpp
|
||||
#RSG
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 17)
|
||||
|
||||
|
||||
@ -870,7 +870,6 @@ namespace
|
||||
int32_t i2 = -1520786086; // 0xA55AA55A
|
||||
float f = 3.1415927f;
|
||||
double d = 3.1415927;
|
||||
long double ld = 3.1414927L;
|
||||
|
||||
std::array<unsigned char, 100> storage;
|
||||
|
||||
@ -884,7 +883,6 @@ namespace
|
||||
bit_stream.put(i2);
|
||||
bit_stream.put(d);
|
||||
bit_stream.put(s2);
|
||||
bit_stream.put(ld);
|
||||
bit_stream.put(c2);
|
||||
|
||||
bit_stream.restart();
|
||||
@ -897,7 +895,6 @@ namespace
|
||||
int32_t ri2;
|
||||
float rf;
|
||||
double rd;
|
||||
long double rld;
|
||||
|
||||
// Read them all back.
|
||||
CHECK(bit_stream.get(rc1));
|
||||
@ -921,9 +918,6 @@ namespace
|
||||
CHECK(bit_stream.get(rs2));
|
||||
CHECK_EQUAL(s2, rs2);
|
||||
|
||||
CHECK(bit_stream.get(rld));
|
||||
CHECK_CLOSE(ld, rld, 0.1);
|
||||
|
||||
CHECK(bit_stream.get(rc2));
|
||||
CHECK_EQUAL(int(c2), int(rc2));
|
||||
}
|
||||
@ -939,7 +933,6 @@ namespace
|
||||
int32_t i2 = -10836646; // 25 bits
|
||||
float f = 3.1415927f;
|
||||
double d = 3.1415927;
|
||||
long double ld = 3.1414927L;
|
||||
int64_t ll = 140737488355327LL;
|
||||
|
||||
std::array<unsigned char, 100> storage;
|
||||
@ -975,38 +968,13 @@ namespace
|
||||
CHECK_EQUAL(22U, bit_stream.size());
|
||||
CHECK_EQUAL(174U, bit_stream.bits());
|
||||
|
||||
if (sizeof(long double) == 8)
|
||||
{
|
||||
bit_stream.put(ld);
|
||||
CHECK_EQUAL(30U, bit_stream.size());
|
||||
CHECK_EQUAL(238U, bit_stream.bits());
|
||||
bit_stream.put(c2, 7);
|
||||
CHECK_EQUAL(23U, bit_stream.size());
|
||||
CHECK_EQUAL(181U, bit_stream.bits());
|
||||
|
||||
bit_stream.put(c2, 7);
|
||||
CHECK_EQUAL(31U, bit_stream.size());
|
||||
CHECK_EQUAL(245U, bit_stream.bits());
|
||||
|
||||
bit_stream.put(ll, 47);
|
||||
CHECK_EQUAL(37U, bit_stream.size());
|
||||
CHECK_EQUAL(292U, bit_stream.bits());
|
||||
}
|
||||
else if (sizeof(long double) == 12)
|
||||
{
|
||||
bit_stream.put(ld);
|
||||
CHECK_EQUAL(34U, bit_stream.size());
|
||||
CHECK_EQUAL(270U, bit_stream.bits());
|
||||
|
||||
bit_stream.put(c2, 7);
|
||||
CHECK_EQUAL(35U, bit_stream.size());
|
||||
CHECK_EQUAL(277U, bit_stream.bits());
|
||||
|
||||
bit_stream.put(ll, 47);
|
||||
CHECK_EQUAL(41U, bit_stream.size());
|
||||
CHECK_EQUAL(324U, bit_stream.bits());
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
bit_stream.put(ll, 47);
|
||||
CHECK_EQUAL(29U, bit_stream.size());
|
||||
CHECK_EQUAL(228U, bit_stream.bits());
|
||||
|
||||
bit_stream.restart();
|
||||
|
||||
@ -1018,7 +986,6 @@ namespace
|
||||
int32_t ri2;
|
||||
float rf;
|
||||
double rd;
|
||||
long double rld;
|
||||
int64_t rll;
|
||||
|
||||
// Read them all back.
|
||||
@ -1043,9 +1010,6 @@ namespace
|
||||
CHECK(bit_stream.get(rs2, 11));
|
||||
CHECK_EQUAL(s2, rs2);
|
||||
|
||||
CHECK(bit_stream.get(rld));
|
||||
CHECK_CLOSE(ld, rld, 0.1);
|
||||
|
||||
CHECK(bit_stream.get(rc2, 7));
|
||||
CHECK_EQUAL(int(c2), int(rc2));
|
||||
|
||||
|
||||
@ -401,6 +401,7 @@ namespace
|
||||
CHECK(parameter_correct);
|
||||
}
|
||||
|
||||
#if !(defined(ETL_COMPILER_GCC) && (__GNUC__ <= 5))
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_member_void_compile_time)
|
||||
{
|
||||
@ -470,6 +471,7 @@ namespace
|
||||
CHECK(function_called);
|
||||
CHECK(parameter_correct);
|
||||
}
|
||||
#endif
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_copy_construct)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user