diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-06-16 17:23:05 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-07-01 07:23:23 -0700 |
commit | 1c60149c94472372bef2578595776930fae0b91d (patch) | |
tree | 4cdd085677d98598ca9043faef420428e7359607 /host/lib/usrp | |
parent | 5ad87c307bd5753fd4ac9e9b433835d2f7b4f4eb (diff) | |
download | uhd-1c60149c94472372bef2578595776930fae0b91d.tar.gz uhd-1c60149c94472372bef2578595776930fae0b91d.tar.bz2 uhd-1c60149c94472372bef2578595776930fae0b91d.zip |
b200: Codec loopback test now throws on failure.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 11 |
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); } |