35#include <boost/test/unit_test.hpp>
41#include <boost/test/tools/floating_point_comparison.hpp>
42#include <boost/test/unit_test.hpp>
54 unsigned int curRow = 0;
55 unsigned int curColumn = 0;
57 BOOST_CHECK_EQUAL(0u, curRow);
58 BOOST_CHECK_EQUAL(1u, curColumn);
61 BOOST_CHECK_EQUAL(1u, curRow);
62 BOOST_CHECK_EQUAL(1u, curColumn);
65 BOOST_CHECK_EQUAL(0u, curRow);
66 BOOST_CHECK_EQUAL(2u, curColumn);
69 BOOST_CHECK_EQUAL(1u, curRow);
70 BOOST_CHECK_EQUAL(2u, curColumn);
73 BOOST_CHECK_EQUAL(2u, curRow);
74 BOOST_CHECK_EQUAL(2u, curColumn);
77 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curRow);
78 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curColumn);
83 unsigned int curRow = 0;
84 unsigned int curColumn = 0;
86 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curRow);
87 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curColumn);
92 unsigned int curRow = 0;
93 unsigned int curColumn = 0;
95 BOOST_CHECK_EQUAL(0u, curRow);
96 BOOST_CHECK_EQUAL(1u, curColumn);
99 BOOST_CHECK_EQUAL(1u, curRow);
100 BOOST_CHECK_EQUAL(1u, curColumn);
102 std::tie(curRow, curColumn) =
Policy::Advance(2, 2, curRow, curColumn);
103 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curRow);
104 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curColumn);
void RedirectCerrIfNeeded()
UpperTriangularMatrixFuncs Policy
BOOST_AUTO_TEST_CASE(TestAdvanceUpperTriangular)
static std::tuple< unsigned int, unsigned int > Advance(const unsigned int totalRows, const unsigned int totalColumns, const unsigned int curRow, const unsigned int curColumn)