X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=test%2Fview%2Fruler.cpp;h=4a4eac8f34d5822cacec1b622c4fe8c8f9f047bc;hb=9a35b05d2f2e5329f1ecaddb04289d4adeea2752;hp=37b8d3826cbdc4ad845b8b7c1c7632019bf269cc;hpb=5955ebeeaca4fc0beb88cbac401052ddc143e80b;p=pulseview.git diff --git a/test/view/ruler.cpp b/test/view/ruler.cpp index 37b8d382..4a4eac8f 100644 --- a/test/view/ruler.cpp +++ b/test/view/ruler.cpp @@ -14,17 +14,21 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#include +#include +#if BOOST_VERSION >= 107100 // 1.71 deprecated the old header location. +#include +#else #include +#endif +#include -#include "pv/view/ruler.hpp" +#include "pv/views/trace/ruler.hpp" #include "test/test.hpp" -using namespace pv::views::TraceView; +using namespace pv::views::trace; namespace { QString format(const pv::util::Timestamp& t) @@ -43,9 +47,10 @@ BOOST_AUTO_TEST_CASE(tick_position_test_0) const pv::util::Timestamp offset("0"); const double scale(0.001); const int width(500); + const unsigned int minor_tick_count(4); - const Ruler::TickPositions ts = Ruler::calculate_tick_positions( - major_period, offset, scale, width, format); + const TickPositions ts = Ruler::calculate_tick_positions( + major_period, offset, scale, width, minor_tick_count, format); BOOST_REQUIRE_EQUAL(ts.major.size(), 6); @@ -89,9 +94,10 @@ BOOST_AUTO_TEST_CASE(tick_position_test_1) const pv::util::Timestamp offset("-0.463"); const double scale(0.001); const int width(500); + const unsigned int minor_tick_count(4); - const Ruler::TickPositions ts = Ruler::calculate_tick_positions( - major_period, offset, scale, width, format); + const TickPositions ts = Ruler::calculate_tick_positions( + major_period, offset, scale, width, minor_tick_count, format); BOOST_REQUIRE_EQUAL(ts.major.size(), 5); @@ -133,9 +139,10 @@ BOOST_AUTO_TEST_CASE(tick_position_test_2) const pv::util::Timestamp offset("8"); const double scale(0.129746); const int width(580); + const unsigned int minor_tick_count(4); - const Ruler::TickPositions ts = Ruler::calculate_tick_positions( - major_period, offset, scale, width, format); + const TickPositions ts = Ruler::calculate_tick_positions( + major_period, offset, scale, width, minor_tick_count, format); const double mp = 5; const int off = 8;