From e8e4fa3f0dec2909d25b1945e3bb2545e82f1034 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 28 Sep 2019 11:25:25 +0100 Subject: [PATCH] Updated unit test project to support C++17 --- include/etl/profiles/msvc_x86.h | 2 +- include/etl/stl/alternate/functional.h | 10 +-- test/CMakeLists.txt | 1 + test/codeblocks/ETL.cbp | 5 +- test/test_algorithm.cpp | 100 +++++++++++++------------ test/test_compiler_settings.cpp | 48 ++++++++++++ test/test_forward_list.cpp | 4 +- test/test_forward_list_shared_pool.cpp | 6 +- test/test_intrusive_forward_list.cpp | 4 +- test/test_intrusive_list.cpp | 2 +- test/test_list.cpp | 4 +- test/test_list_shared_pool.cpp | 6 +- test/test_no_stl_algorithm.cpp | 2 +- test/test_no_stl_functional.cpp | 4 +- test/vs2017/etl.vcxproj | 3 +- test/vs2017/etl.vcxproj.filters | 3 + 16 files changed, 132 insertions(+), 72 deletions(-) create mode 100644 test/test_compiler_settings.cpp diff --git a/include/etl/profiles/msvc_x86.h b/include/etl/profiles/msvc_x86.h index d4286277..8f657d53 100644 --- a/include/etl/profiles/msvc_x86.h +++ b/include/etl/profiles/msvc_x86.h @@ -40,7 +40,7 @@ SOFTWARE. #define ETL_COMPILER_MICROSOFT #define ETL_CPP11_SUPPORTED (_MSC_VER >= 1600) #define ETL_CPP14_SUPPORTED (_MSC_VER >= 1900) -#define ETL_CPP17_SUPPORTED 0 +#define ETL_CPP17_SUPPORTED (_MSC_VER >= 1914) #define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED #define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED #define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED diff --git a/include/etl/stl/alternate/functional.h b/include/etl/stl/alternate/functional.h index 58adcdbf..0538eb40 100644 --- a/include/etl/stl/alternate/functional.h +++ b/include/etl/stl/alternate/functional.h @@ -61,7 +61,7 @@ template struct unary_function { - typedef TArgumentType aurgument_type; + typedef TArgumentType argument_type; typedef TResultType result_type; }; @@ -70,15 +70,15 @@ template struct binary_function { - typedef TFirstArgumentType first_aurgument_type; - typedef TSecondArgumentType second_aurgument_type; + typedef TFirstArgumentType first_argument_type; + typedef TSecondArgumentType second_argument_type; typedef TResultType result_type; }; //*************************************************************************** template - class binder1st : public ETLSTD::unary_function + class binder1st : public ETLSTD::unary_function { protected: @@ -112,7 +112,7 @@ //*************************************************************************** template - class binder2nd : public ETLSTD::unary_function + class binder2nd : public ETLSTD::unary_function { protected: TFunction operation; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c71b9b35..af18f98b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -36,6 +36,7 @@ set(TEST_SOURCE_FILES test_callback_timer.cpp test_checksum.cpp test_compare.cpp + test_compiler_settings.cpp test_constant.cpp test_container.cpp test_crc.cpp diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index ebcc60ce..399feed4 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -12,7 +12,7 @@