aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/mb_controller_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/tests/mb_controller_test.cpp')
-rw-r--r--host/tests/mb_controller_test.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/host/tests/mb_controller_test.cpp b/host/tests/mb_controller_test.cpp
index 48baadf29..b6fb49371 100644
--- a/host/tests/mb_controller_test.cpp
+++ b/host/tests/mb_controller_test.cpp
@@ -14,13 +14,25 @@ using namespace uhd::rfnoc;
class mock_timekeeper : public mb_controller::timekeeper
{
public:
- uint64_t get_ticks_now() { return _ticks; }
+ uint64_t get_ticks_now()
+ {
+ return _ticks;
+ }
- uint64_t get_ticks_last_pps() { return _ticks; }
+ uint64_t get_ticks_last_pps()
+ {
+ return _ticks;
+ }
- void set_ticks_now(const uint64_t ticks) { _ticks = ticks; }
+ void set_ticks_now(const uint64_t ticks)
+ {
+ _ticks = ticks;
+ }
- void set_ticks_next_pps(const uint64_t ticks) { _ticks = ticks; }
+ void set_ticks_next_pps(const uint64_t ticks)
+ {
+ _ticks = ticks;
+ }
uint64_t _ticks;
uint64_t _period;
@@ -31,7 +43,10 @@ public:
}
private:
- void set_period(const uint64_t period_ns) { _period = period_ns; }
+ void set_period(const uint64_t period_ns)
+ {
+ _period = period_ns;
+ }
};
class mock_mb_controller : public mb_controller
@@ -124,9 +139,9 @@ public:
}
std::string clock_source = "internal";
- std::string time_source = "internal";
- bool clock_source_out = false;
- bool time_source_out = false;
+ std::string time_source = "internal";
+ bool clock_source_out = false;
+ bool time_source_out = false;
};
BOOST_AUTO_TEST_CASE(test_mb_controller)
@@ -134,7 +149,7 @@ BOOST_AUTO_TEST_CASE(test_mb_controller)
auto mmbc = std::make_shared<mock_mb_controller>();
BOOST_REQUIRE_EQUAL(mmbc->get_num_timekeepers(), 1);
- auto tk = mmbc->get_timekeeper(0);
+ auto tk = mmbc->get_timekeeper(0);
auto tk_mock = std::dynamic_pointer_cast<mock_timekeeper>(tk);
BOOST_REQUIRE(tk);
@@ -152,4 +167,3 @@ BOOST_AUTO_TEST_CASE(test_mb_controller)
tk->set_time_next_pps(uhd::time_spec_t(TIME_1));
BOOST_CHECK_EQUAL(tk->get_ticks_last_pps(), TIME_1 * TICK_RATE);
}
-