Changeset c075647a in mainline


Ignore:
Timestamp:
2018-07-05T21:41:23Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46cf7bf
Parents:
eaabd7d
git-author:
Dzejrou <dzejrou@…> (2018-05-12 01:07:18)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: added deque tests

Location:
uspace/lib/cpp
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/Makefile

    reaabd7d rc075647a  
    5757        src/internal/test/array.cpp \
    5858        src/internal/test/bitset.cpp \
     59        src/internal/test/deque.cpp \
    5960        src/internal/test/vector.cpp \
    6061        src/internal/test/string.cpp \
  • uspace/lib/cpp/include/internal/test/test.hpp

    reaabd7d rc075647a  
    3232#include <utility>
    3333#include <iterator>
     34#include <type_traits>
    3435
    3536namespace std::test
     
    8384                           Iterator2 first2, Iterator2 last2)
    8485            {
    85                 if (std::distance(first1, last1) != std::distance(first2, last2))
     86                auto len1 = std::distance(first1, last1);
     87                auto len2 = std::distance(first2, last2);
     88
     89                using common_t = std::common_type_t<decltype(len1), decltype(len2)>;
     90                auto len1_common = static_cast<common_t>(len1);
     91                auto len2_common = static_cast<common_t>(len2);
     92
     93                if (len1_common != len2_common)
    8694                    return false;
    8795
  • uspace/lib/cpp/include/internal/test/tests.hpp

    reaabd7d rc075647a  
    138138            void test_operations();
    139139    };
     140
     141    class deque_test: public test_suite
     142    {
     143        public:
     144            bool run(bool) override;
     145            const char* name() override;
     146
     147        private:
     148            void test_constructors_and_assignment();
     149            void test_resizing();
     150            void test_push_pop();
     151            void test_operations();
     152    };
    140153}
    141154
Note: See TracChangeset for help on using the changeset viewer.