aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-10-07 16:44:49 -0700
committerMartin Braun <martin.braun@ettus.com>2016-10-07 16:44:49 -0700
commit1b70b3e70df40aae4d1e53037212d77af2fdc4e4 (patch)
treedcde2a418b7cfb4672e5ef5e57bbf85ae3c2d4b1 /host/examples
parent811444b126ed40aed115af4464422122afd0c607 (diff)
parent006c321c552781501bcb0cff9e156c991c24ce45 (diff)
downloaduhd-1b70b3e70df40aae4d1e53037212d77af2fdc4e4.tar.gz
uhd-1b70b3e70df40aae4d1e53037212d77af2fdc4e4.tar.bz2
uhd-1b70b3e70df40aae4d1e53037212d77af2fdc4e4.zip
Merge branch 'maint'
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/benchmark_rate.cpp7
-rw-r--r--host/examples/test_messages.cpp15
2 files changed, 14 insertions, 8 deletions
diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp
index 1ea754ef2..6854fa43d 100644
--- a/host/examples/benchmark_rate.cpp
+++ b/host/examples/benchmark_rate.cpp
@@ -433,7 +433,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
std::cout << boost::format("Setting device timestamp to 0...") << std::endl;
- bool sync_channels = (pps == "mimo" or ref == "mimo" or (rx_channel_nums.size() <= 1 and tx_channel_nums.size() <= 1));
+ const bool sync_channels =
+ pps == "mimo" or
+ ref == "mimo" or
+ rx_channel_nums.size() > 1 or
+ tx_channel_nums.size() > 1
+ ;
if (!sync_channels) {
usrp->set_time_now(0.0);
} else {
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;
}