text: // Copyright (c) 2013-2014 Josh Blum
  // SPDX-License-Identifier: BSL-1.0
  
  #include <Pothos/Testing.hpp>
  #include <Pothos/Framework.hpp>
  #include <Pothos/Proxy.hpp>
  #include <Poco/JSON/Object.h>
  #include <iostream>
  
  POTHOS_TEST_BLOCK("/zynq/tests", test_zynq_dma_loopback)
  {
      auto env = Pothos::ProxyEnvironment::make("managed");
      auto registry = env->findProxy("Pothos/BlockRegistry");
  
      auto feeder = registry.callProxy("/blocks/feeder_source", "int");
      auto collector = registry.callProxy("/blocks/collector_sink", "int");
  
      auto dmaSrc = registry.callProxy("/zynq/dma_source", 0);
      auto dmaSink = registry.callProxy("/zynq/dma_sink", 0);
  
      //create a test plan
      Poco::JSON::Object::Ptr testPlan(new Poco::JSON::Object());
      testPlan->set("enableBuffers", true);
      auto expected = feeder.callProxy("feedTestPlan", testPlan);
  
      //run the topology
      {
          Pothos::Topology topology;
          topology.connect(feeder, 0, dmaSink, 0);
          topology.connect(dmaSrc, 0, collector, 0);
          topology.commit();
          POTHOS_TEST_TRUE(topology.waitInactive());
      }
  
      collector.callVoid("verifyTestPlan", expected);
  }
  