Skip to content

Commit

Permalink
Expand flat_map testing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Sep 8, 2024
1 parent c552a23 commit daa81ed
Show file tree
Hide file tree
Showing 3 changed files with 331 additions and 244 deletions.
27 changes: 13 additions & 14 deletions test/flat_map_adaptor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <boost/container/detail/container_or_allocator_rebind.hpp>

#include "map_test.hpp"
#include "flat_map_test.hpp"
#include <map>

using namespace boost::container;
Expand Down Expand Up @@ -54,58 +54,57 @@ int main()
typedef std::map<int, int> MyStdMap;
typedef std::multimap<int, int> MyStdMultiMap;

if (0 != test::map_test
if (0 != test::flat_map_test
< GetMapContainer<vector<std::pair<int, int> > >::apply<int>::map_type
, MyStdMap
, GetMapContainer<vector<std::pair<int, int> > >::apply<int>::multimap_type
, MyStdMultiMap>()) {
std::cout << "Error in map_test<vector<std::pair<int, int> > >" << std::endl;
std::cout << "Error in flat_map_test<vector<std::pair<int, int> > >" << std::endl;
return 1;
}

if (0 != test::map_test
if (0 != test::flat_map_test
< GetMapContainer<small_vector<std::pair<int, int>, 7> >::apply<int>::map_type
, MyStdMap
, GetMapContainer<small_vector<std::pair<int, int>, 7> >::apply<int>::multimap_type
, MyStdMultiMap>()) {
std::cout << "Error in map_test<small_vector<std::pair<int, int>, 7> >" << std::endl;
std::cout << "Error in flat_map_test<small_vector<std::pair<int, int>, 7> >" << std::endl;
return 1;
}

if (0 != test::map_test
if (0 != test::flat_map_test
< GetMapContainer<static_vector<std::pair<int, int>, MaxElem * 10> >::apply<int>::map_type
, MyStdMap
, GetMapContainer<static_vector<std::pair<int, int>, MaxElem * 10> >::apply<int>::multimap_type
, MyStdMultiMap>()) {
std::cout << "Error in map_test<static_vector<std::pair<int, int>, MaxElem * 10> >" << std::endl;
std::cout << "Error in flat_map_test<static_vector<std::pair<int, int>, MaxElem * 10> >" << std::endl;
return 1;
}

if (0 != test::map_test
if (0 != test::flat_map_test
< GetMapContainer<stable_vector<std::pair<int, int> > >::apply<int>::map_type
, MyStdMap
, GetMapContainer<stable_vector<std::pair<int, int> > >::apply<int>::multimap_type
, MyStdMultiMap>()) {
std::cout << "Error in map_test<stable_vector<std::pair<int, int> > >" << std::endl;
std::cout << "Error in flat_map_test<stable_vector<std::pair<int, int> > >" << std::endl;
return 1;
}


if (0 != test::map_test
if (0 != test::flat_map_test
< GetMapContainer<deque<std::pair<int, int> > >::apply<int>::map_type
, MyStdMap
, GetMapContainer<deque<std::pair<int, int> > >::apply<int>::multimap_type
, MyStdMultiMap>()) {
std::cout << "Error in map_test<deque<std::pair<int, int> > >" << std::endl;
std::cout << "Error in flat_map_test<deque<std::pair<int, int> > >" << std::endl;
return 1;
}

if (0 != test::map_test
if (0 != test::flat_map_test
< GetMapContainer<devector<std::pair<int, int> > >::apply<int>::map_type
, MyStdMap
, GetMapContainer<devector<std::pair<int, int> > >::apply<int>::multimap_type
, MyStdMultiMap>()) {
std::cout << "Error in map_test<vector<std::pair<int, int> > >" << std::endl;
std::cout << "Error in flat_map_test<vector<std::pair<int, int> > >" << std::endl;
return 1;
}
}
Expand Down
Loading

0 comments on commit daa81ed

Please sign in to comment.