Skip to content

Commit

Permalink
[tests] Fix tests failing due to graph object being too large
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Oct 30, 2022
1 parent 03fd734 commit fb86718
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
6 changes: 3 additions & 3 deletions examples/Dataflow/MiniDAW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ int main(int argc, char** argv)
using namespace std::literals;

// Setup our datastructures
ossia::tc_graph graph;
auto graph = std::make_unique<ossia::tc_graph>();
ossia::audio_device audio{
"minidaw", // name, for APIs like JACK
256, // buffer size
Expand All @@ -274,10 +274,10 @@ int main(int argc, char** argv)
e.samplesToModelRatio = ossia::flicks_per_second<double> / audio.get_sample_rate();
e.register_device(&audio.device);

auto root_interval = create_score(graph, audio);
auto root_interval = create_score(*graph, audio);
root_interval->start();

audio.engine->set_tick(tick{e, graph, audio.protocol, *root_interval});
audio.engine->set_tick(tick{e, *graph, audio.protocol, *root_interval});

std::this_thread::sleep_for(20s);

Expand Down
3 changes: 2 additions & 1 deletion examples/Dataflow/MixSines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ int main(int argc, char** argv)
using namespace ossia;
using namespace std::literals;

tc_graph g;
auto gg = std::make_unique<tc_graph>(); // graph implementation with static scheduling
auto& g = *gg;
execution_state e;
audio_device audio;

Expand Down
3 changes: 2 additions & 1 deletion examples/Dataflow/MixSinesAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ int main(int argc, char** argv)
using namespace ossia;
using namespace std::literals;
oscquery_device osc; // a device to expose parameters over the network
tc_graph g; // graph implementation with static scheduling
auto gg = std::make_unique<tc_graph>(); // graph implementation with static scheduling
auto& g = *gg;
execution_state e;
audio_device audio; // a device that maps to the sound card inputs & outputs

Expand Down
1 change: 1 addition & 0 deletions src/ossia/network/value/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <boost/algorithm/string/replace.hpp>

#include <sstream>
#include <type_traits>

/*
template class std::vector<ossia::value>;
Expand Down
9 changes: 9 additions & 0 deletions src/ossia_setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif()
endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
target_compile_options(ossia
PUBLIC
-fconcepts
)
endif()
endif()

if(WIN32)
if(MSVC)
target_compile_definitions(ossia PUBLIC
Expand Down
16 changes: 10 additions & 6 deletions tests/Dataflow/DataflowTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ struct execution_mock

struct base_graph
{
//ossia::graph g;
ossia::tc_graph g;
std::unique_ptr<ossia::tc_graph> gg = std::make_unique<ossia::tc_graph>();
ossia::tc_graph& g = *gg;
ossia::execution_state e;

base_graph(ossia::TestDevice& test) { e.register_device(&test.device); }
Expand Down Expand Up @@ -428,7 +428,8 @@ struct bc_ab_graph : base_graph
TEST_CASE("test_bfs", "test_bfs")
{
using namespace ossia;
ossia::bfs_graph g;
auto gg = std::make_unique<bfs_graph>();
auto& g = *gg;
auto n1 = boost::add_vertex({}, g.impl());
auto n2 = boost::add_vertex({}, g.impl());
auto n3 = boost::add_vertex({}, g.impl());
Expand All @@ -444,7 +445,8 @@ TEST_CASE("test_bfs_addr", "test_bfs_addr")

TestDevice test;

ossia::bfs_graph g;
auto gg = std::make_unique<bfs_graph>();
auto& g = *gg;
auto n1 = std::make_shared<node_mock>(
ossia::inlets{new value_inlet(*test.a)},
ossia::outlets{new value_outlet(*test.b)});
Expand Down Expand Up @@ -488,7 +490,8 @@ TEST_CASE("test_tcl_addr", "test_tcl_addr")
TEST_CASE("test_mock", "test_mock")
{
using namespace ossia;
graph g;
auto gg = std::make_unique<graph>();
auto& g = *gg;

auto n1
= std::make_shared<node_mock>(inlets{new value_inlet}, outlets{new value_outlet});
Expand Down Expand Up @@ -553,7 +556,8 @@ TEST_CASE("test_mock", "test_mock")
TEST_CASE("test_disable_strict_nodes", "test_disable_strict_nodes")
{
using namespace ossia;
ossia::graph g;
auto gg = std::make_unique<graph>();
auto& g = *gg;
auto disable_nodes = [&](std::vector<std::shared_ptr<node_mock>> nodes) {
node_flat_set enabled, disabled;
for(auto node : nodes)
Expand Down
10 changes: 7 additions & 3 deletions tests/Editor/ScenarioAlgoTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ TEST_CASE("test_simulated_state", "test_simulated_state")

REQUIRE(utils.float_addr->value() == ossia::value(float(0.)));

ossia::graph g;
auto gg = std::make_unique<graph>();
auto& g = *gg;
ossia::execution_state e;
g.add_node(msg_node);
g.state(e);
Expand Down Expand Up @@ -913,7 +914,9 @@ TEST_CASE("test_percentage", "test_percentage")
using namespace ossia;
root_scenario s;
TestDevice utils;
ossia::graph g;

auto gg = std::make_unique<graph>();
auto& g = *gg;

ossia::scenario& scenario = *s.scenario;
std::shared_ptr<time_event> e0 = start_event(scenario);
Expand Down Expand Up @@ -966,7 +969,8 @@ TEST_CASE("test_percentage_long", "test_percentage_long")
using namespace ossia;
root_scenario s;
TestDevice utils;
ossia::graph g;
auto gg = std::make_unique<graph>();
auto& g = *gg;

ossia::scenario& scenario = *s.scenario;
std::shared_ptr<time_event> e0 = start_event(scenario);
Expand Down

0 comments on commit fb86718

Please sign in to comment.