aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/test_messages.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-09-28 10:20:04 -0700
committerMartin Braun <martin.braun@ettus.com>2016-09-28 10:20:04 -0700
commit92cc4d83dfc56f9ce712588c18b860334ab461da (patch)
tree635783cb9e15a53e3fc6f005a0eb24ed9f634c8a /host/examples/test_messages.cpp
parent39888bb34060ce71b9270e1d0bb5bc027d2a336f (diff)
downloaduhd-92cc4d83dfc56f9ce712588c18b860334ab461da.tar.gz
uhd-92cc4d83dfc56f9ce712588c18b860334ab461da.tar.bz2
uhd-92cc4d83dfc56f9ce712588c18b860334ab461da.zip
examples: Fixed test_messages
Diffstat (limited to 'host/examples/test_messages.cpp')
-rw-r--r--host/examples/test_messages.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/host/examples/test_messages.cpp b/host/examples/test_messages.cpp
index 4240e830b..4c07d34b1 100644
--- a/host/examples/test_messages.cpp
+++ b/host/examples/test_messages.cpp
@@ -143,10 +143,7 @@ bool test_burst_ack_message(uhd::usrp::multi_usrp::sptr, uhd::rx_streamer::sptr,
//3 times max-sps guarantees a SOB, no burst, and EOB packet
std::vector<std::complex<float> > buff(tx_stream->get_max_num_samps()*3);
-
- tx_stream->send(
- &buff.front(), buff.size(), md
- );
+ tx_stream->send(&buff.front(), buff.size(), md);
uhd::async_metadata_t async_md;
if (not tx_stream->recv_async_msg(async_md)){
@@ -187,7 +184,8 @@ bool test_underflow_message(uhd::usrp::multi_usrp::sptr, uhd::rx_streamer::sptr,
md.end_of_burst = false;
md.has_time_spec = false;
- tx_stream->send("", 0, md);
+ std::vector< std::complex<float> > buff(tx_stream->get_max_num_samps());
+ tx_stream->send(&buff.front(), buff.size(), md);
uhd::async_metadata_t async_md;
if (not tx_stream->recv_async_msg(async_md, 1)){
@@ -231,7 +229,8 @@ bool test_time_error_message(uhd::usrp::multi_usrp::sptr usrp, uhd::rx_streamer:
usrp->set_time_now(uhd::time_spec_t(200.0)); //time at 200s
- tx_stream->send("", 0, md);
+ std::vector< std::complex<float> > buff(tx_stream->get_max_num_samps());
+ tx_stream->send(&buff.front(), buff.size(), md);
uhd::async_metadata_t async_md;
if (not tx_stream->recv_async_msg(async_md)){
@@ -341,15 +340,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
//print the result summary
+ bool any_failure = false;
std::cout << std::endl << "Summary:" << std::endl << std::endl;
BOOST_FOREACH(const std::string &key, tests.keys()){
std::cout << boost::format(
"%s -> %3u successes, %3u failures"
) % key % successes[key] % failures[key] << std::endl;
+ any_failure = any_failure or bool(failures[key]);
}
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return EXIT_SUCCESS;
+ return any_failure ? EXIT_FAILURE : EXIT_SUCCESS;
}