35#include <boost/test/unit_test.hpp>
40#include <boost/test/tools/floating_point_comparison.hpp>
41#include <boost/test/unit_test.hpp>
52 unsigned int curRow = 0;
53 unsigned int curColumn = 0;
55 BOOST_CHECK_EQUAL(1, curRow);
56 BOOST_CHECK_EQUAL(0, curColumn);
59 BOOST_CHECK_EQUAL(2, curRow);
60 BOOST_CHECK_EQUAL(0, curColumn);
63 BOOST_CHECK_EQUAL(0, curRow);
64 BOOST_CHECK_EQUAL(1, curColumn);
67 BOOST_CHECK_EQUAL(1, curRow);
68 BOOST_CHECK_EQUAL(1, curColumn);
71 BOOST_CHECK_EQUAL(2, curRow);
72 BOOST_CHECK_EQUAL(1, curColumn);
75 BOOST_CHECK_EQUAL(0, curRow);
76 BOOST_CHECK_EQUAL(2, curColumn);
79 BOOST_CHECK_EQUAL(1, curRow);
80 BOOST_CHECK_EQUAL(2, curColumn);
83 BOOST_CHECK_EQUAL(2, curRow);
84 BOOST_CHECK_EQUAL(2, curColumn);
87 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curRow);
88 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curColumn);
93 unsigned int curRow = 0;
94 unsigned int curColumn = 0;
96 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curRow);
97 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curColumn);
102 unsigned int curRow = 0;
103 unsigned int curColumn = 0;
104 std::tie(curRow, curColumn) =
Policy::Advance(2, 2, curRow, curColumn);
105 BOOST_CHECK_EQUAL(1, curRow);
106 BOOST_CHECK_EQUAL(0, curColumn);
108 std::tie(curRow, curColumn) =
Policy::Advance(2, 2, curRow, curColumn);
109 BOOST_CHECK_EQUAL(0, curRow);
110 BOOST_CHECK_EQUAL(1, curColumn);
112 std::tie(curRow, curColumn) =
Policy::Advance(2, 2, curRow, curColumn);
113 BOOST_CHECK_EQUAL(1, curRow);
114 BOOST_CHECK_EQUAL(1, curColumn);
116 std::tie(curRow, curColumn) =
Policy::Advance(2, 2, curRow, curColumn);
117 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curRow);
118 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(), curColumn);
BOOST_AUTO_TEST_CASE(TestAdvanceSymmetric)
SymmetricMatrixFuncs Policy
void RedirectCerrIfNeeded()
static std::tuple< unsigned int, unsigned int > Advance(const unsigned int totalRows, const unsigned int totalColumns, const unsigned int curRow, const unsigned int curColumn)