4#include <boost/test/unit_test_suite.hpp>
27 BOOST_TEST(a.size() == 3);
28 BOOST_TEST(a.at(0) == 1);
29 BOOST_TEST(a.at(1) == 2);
30 BOOST_TEST(a.at(2) == 3);
37 std::vector<int> y{1, 2, 3, 4, 5, 6, 7, 8, 9};
41 std::vector<int> n1{1, 2, 3, 4, 5, 6, 7, 8, 9, 9};
45 std::vector<int> n2{1, 1, 3, 4, 5, 6, 7, 8, 9};
58 Eigen::VectorXd v1(3);
60 Eigen::VectorXd v2(3);
62 Eigen::VectorXd v3(3);
65 std::vector<Eigen::VectorXd> case1{};
68 std::vector<Eigen::VectorXd> case2{v1};
71 std::vector<Eigen::VectorXd> case3{v1, v2};
74 std::vector<Eigen::VectorXd> case4{v1, v2, v1};
77 std::vector<Eigen::VectorXd> case5{v1, v2, v3};
80 std::vector<Eigen::VectorXd> case6{v1, v2, v3, v1};
88 std::vector<int> a{1, 2, 3, 4, 5, 6, 7, 8, 9};
89 std::vector<int> b{1, 2, 3, 4, 5, 0, 9};
94 BOOST_TEST((aa.first == aa.second));
95 BOOST_TEST((aa.first == a.end()));
100 BOOST_TEST((ab.first != a.end()));
101 BOOST_TEST(*ab.first == 6);
102 BOOST_TEST(*ab.second == 0);
111 std::vector<int> a{1, 2, 3, 4, 5, 6, 0};
112 std::ostringstream oss;
114 std::string str{oss.str()};
115 BOOST_TEST(str ==
"[1, 2, ... , 6, 0] min:0 max:6");
122 std::vector<int> a{1, 2, 3, 4, 5, 6, 0};
123 std::ostringstream oss;
125 std::string str{oss.str()};
126 BOOST_TEST(str ==
"[ ... ] min:0 max:6");
134 std::ostringstream oss;
136 std::string str{oss.str()};
137 BOOST_TEST(str ==
"<Empty Range>");
148 std::array<int, 1> input{1};
149 std::array<int, 1> order{0};
150 std::array<int, 1> expected{1};
153 BOOST_TEST(reordered == expected);
160 std::array<int, 3> input{3, 4, 5};
161 std::array<int, 3> order{0, 1, 2};
162 std::array<int, 3> expected{3, 4, 5};
165 BOOST_TEST(reordered == expected);
172 std::array<int, 3> input{3, 4, 5};
173 std::array<int, 3> order{2, 1, 0};
174 std::array<int, 3> expected{5, 4, 3};
177 BOOST_TEST(reordered == expected);
184 std::array<int, 3> input{3, 4, 5};
185 std::array<int, 3> order{2, 0, 1};
186 std::array<int, 3> expected{5, 3, 4};
189 BOOST_TEST(reordered == expected);
198 std::array<int *, 3> input{&a, &b,
nullptr};
199 std::array<int, 3> order{2, 0, 1};
200 std::array<int *, 3> expected{
nullptr, &a, &b};
203 BOOST_TEST(reordered == expected);
214 std::vector v{0, 1, 2, 3};
217 BOOST_TEST((first == v.end()));
218 BOOST_TEST((last == v.end()));
225 std::vector v{0, 1, 2, 3};
228 BOOST_TEST((first == v.begin()));
229 BOOST_TEST((last == v.end() - 1));
236 std::vector v{0, 1, 2, 3};
239 BOOST_TEST((first == v.begin()));
240 BOOST_TEST((last == v.begin()));
247 std::vector v{0, 0, 2, 3};
250 BOOST_TEST((first == v.begin()));
251 BOOST_TEST((last == v.begin() + 1));
258 std::vector v{0, 1, 2, 3};
261 BOOST_TEST((first == v.end() - 1));
262 BOOST_TEST((last == first));
269 std::vector v{1, 2, 3, 3};
272 BOOST_TEST((first == v.end() - 2));
273 BOOST_TEST((last == v.end() - 1));
280 std::vector v{1, 2, 3, 4};
283 BOOST_TEST((first == v.begin() + 1));
284 BOOST_TEST((last == first));
291 std::vector v{1, 2, 2, 3};
294 BOOST_TEST((first == v.begin() + 1));
295 BOOST_TEST((last == v.begin() + 2));
302 std::vector v{1, 2, 3, 4, 5, 3};
305 BOOST_TEST((first == v.begin() + 2));
306 BOOST_TEST((last == first));
313 std::vector v{1, 2, 2, 4, 2, 2};
316 BOOST_TEST((first == v.begin() + 1));
317 BOOST_TEST((last == v.begin() + 2));
BOOST_AUTO_TEST_CASE(testIQNIMVJPPWithSubsteps)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
contains precice-related utilities.
auto reorder_array(const std::array< Index, n > &order, const std::array< T, n > &elements) -> std::array< T, n >
Reorders an array given an array of unique indices.
std::pair< InputIt, InputIt > find_first_range(InputIt first, InputIt last, Predicate p)
Finds the first range in [first, last[ that fulfills a predicate.
const RangePreview< Iter > previewRange(Size n, const Range &range)
bool unique_elements(const Container &c, BinaryPredicate p={})
auto make_array(Elements &&...elements) -> std::array< typename std::common_type< Elements... >::type, sizeof...(Elements)>
Function that generates an array from given elements.
std::pair< InputIt1, InputIt2 > mismatch(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
Main namespace of the precice library.