aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index ddbaa7cd0..55ae29575 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -735,7 +735,6 @@ void b200_impl::register_loopback_self_test(wb_iface::sptr iface)
void b200_impl::codec_loopback_self_test(wb_iface::sptr iface)
{
- bool test_fail = false;
UHD_MSG(status) << "Performing CODEC loopback test... " << std::flush;
size_t hash = size_t(time(NULL));
for (size_t i = 0; i < 100; i++)
@@ -747,11 +746,13 @@ void b200_impl::codec_loopback_self_test(wb_iface::sptr iface)
const boost::uint64_t rb_word64 = iface->peek64(RB64_CODEC_READBACK);
const boost::uint32_t rb_tx = boost::uint32_t(rb_word64 >> 32);
const boost::uint32_t rb_rx = boost::uint32_t(rb_word64 & 0xffffffff);
- test_fail = word32 != rb_tx or word32 != rb_rx;
- if (test_fail) break; //exit loop on any failure
+ bool test_fail = word32 != rb_tx or word32 != rb_rx;
+ if (test_fail) {
+ UHD_MSG(status) << "fail" << std::endl;
+ throw uhd::runtime_error("CODEC loopback test failed.");
+ }
}
- UHD_MSG(status) << ((test_fail)? "fail" : "pass") << std::endl;
-
+ UHD_MSG(status) << "pass" << std::endl;
/* Zero out the idle data. */
iface->poke32(TOREG(SR_CODEC_IDLE), 0);
}