diff options
| author | Martin Braun <martin.braun@ettus.com> | 2016-10-19 13:45:12 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2016-10-19 13:55:10 -0700 | 
| commit | bd8409cc7602946ed8dc1cfb05d2383eea939800 (patch) | |
| tree | ee217b1797c4d8b3a1de8d44dafbc0461d68a087 | |
| parent | ad5b10677c91494f87c363e9096b7a2e61e414f6 (diff) | |
| download | uhd-bd8409cc7602946ed8dc1cfb05d2383eea939800.tar.gz uhd-bd8409cc7602946ed8dc1cfb05d2383eea939800.tar.bz2 uhd-bd8409cc7602946ed8dc1cfb05d2383eea939800.zip  | |
tests: Updated RFNoC tests after some API changes
| -rw-r--r-- | host/tests/graph.hpp | 6 | ||||
| -rw-r--r-- | host/tests/graph_search_test.cpp | 2 | ||||
| -rw-r--r-- | host/tests/tick_node_test.cpp | 17 | 
3 files changed, 19 insertions, 6 deletions
diff --git a/host/tests/graph.hpp b/host/tests/graph.hpp index 0c2be0347..894c436b3 100644 --- a/host/tests/graph.hpp +++ b/host/tests/graph.hpp @@ -43,8 +43,10 @@ private:  void connect_nodes(uhd::rfnoc::source_node_ctrl::sptr A, uhd::rfnoc::sink_node_ctrl::sptr B)  { -    A->connect_downstream(B); -    B->connect_upstream(A); +    const size_t actual_src_port = A->connect_downstream(B); +    const size_t actual_dst_port = B->connect_upstream(A); +    A->set_downstream_port(actual_src_port, actual_dst_port); +    B->set_upstream_port(actual_dst_port, actual_src_port);  }  #endif /* INCLUDED_TEST_GRAPH_HPP */ diff --git a/host/tests/graph_search_test.cpp b/host/tests/graph_search_test.cpp index 4106d724e..8c96bb954 100644 --- a/host/tests/graph_search_test.cpp +++ b/host/tests/graph_search_test.cpp @@ -1,5 +1,5 @@  // -// Copyright 2014 Ettus Research LLC +// Copyright 2014-2016 Ettus Research LLC  //  // This program is free software: you can redistribute it and/or modify  // it under the terms of the GNU General Public License as published by diff --git a/host/tests/tick_node_test.cpp b/host/tests/tick_node_test.cpp index fc1b8c544..6b150953b 100644 --- a/host/tests/tick_node_test.cpp +++ b/host/tests/tick_node_test.cpp @@ -60,6 +60,8 @@ BOOST_AUTO_TEST_CASE(test_simplest_downstream_search)      // Simplest possible scenario: Connect B downstream of A and let      // it find B      connect_nodes(node_A, node_B); +    node_A->set_tx_streamer(true, 0); +    node_B->set_rx_streamer(true, 0);      double result_rate = node_A->get_tick_rate();      BOOST_CHECK_EQUAL(result_rate, test_rate); @@ -72,12 +74,13 @@ BOOST_AUTO_TEST_CASE(test_both_ways_search)      MAKE_TICK_NODE(node_B);      MAKE_TICK_SETTING_NODE(node_C, test_rate); -    std::cout << "a->b" << std::endl;      connect_nodes(node_A, node_B); -    std::cout << "b->a" << std::endl;      connect_nodes(node_B, node_C); +    node_A->set_tx_streamer(true, 0); +    node_B->set_tx_streamer(true, 0); +    node_B->set_rx_streamer(true, 0); +    node_C->set_rx_streamer(true, 0); -    std::cout << "search" << std::endl;      double result_rate = node_B->get_tick_rate();      BOOST_CHECK_EQUAL(result_rate, test_rate);  } @@ -91,6 +94,10 @@ BOOST_AUTO_TEST_CASE(test_both_ways_search_reversed)      connect_nodes(node_A, node_B);      connect_nodes(node_B, node_C); +    node_A->set_tx_streamer(true, 0); +    node_B->set_tx_streamer(true, 0); +    node_B->set_rx_streamer(true, 0); +    node_C->set_rx_streamer(true, 0);      double result_rate = node_B->get_tick_rate();      BOOST_CHECK_EQUAL(result_rate, test_rate); @@ -105,6 +112,10 @@ BOOST_AUTO_TEST_CASE(test_both_ways_search_fail)      connect_nodes(node_A, node_B);      connect_nodes(node_B, node_C); +    node_A->set_tx_streamer(true, 0); +    node_B->set_tx_streamer(true, 0); +    node_B->set_rx_streamer(true, 0); +    node_C->set_rx_streamer(true, 0);      BOOST_CHECK_THROW(node_B->get_tick_rate(), uhd::runtime_error);  }  | 
