diff --git a/unit_tests/scheduler/Test_Scheduler.cpp b/unit_tests/scheduler/Test_Scheduler.cpp index 7e28f1fadc56855d266c1e8547261f5903f8c724..32f5eb0014cfeb7894e0f9cc7dba47941862330f 100644 --- a/unit_tests/scheduler/Test_Scheduler.cpp +++ b/unit_tests/scheduler/Test_Scheduler.cpp @@ -30,17 +30,21 @@ using namespace Aidge; TEST_CASE("randomScheduling", "[Scheduler][randomGen]") { - const size_t nbTests = 100; + const size_t nbTests = 30; size_t nbUnicity = 0; + std::uniform_int_distribution<std::size_t> nb_nodes_dist(1, 100); for (int test = 0; test < nbTests; ++test) { std::random_device rd; const std::mt19937::result_type seed(rd()); + std::mt19937 gen(rd()); RandomGraph randGraph; randGraph.acyclic = true; const auto g1 = std::make_shared<GraphView>("g1"); - const bool unicity1 = g1->add(randGraph.gen(seed, 10)); + const size_t nb_nodes = nb_nodes_dist(gen); + const bool unicity1 = g1->add(randGraph.gen(seed, nb_nodes)); + g1->save("test_graph_"+std::to_string(test)); if (unicity1) { for (auto& node : g1->getNodes()) { @@ -69,7 +73,7 @@ TEST_CASE("randomScheduling", "[Scheduler][randomGen]") { [&namePtrTable](auto val){ return namePtrTable.at(val); }); fmt::print("schedule: {}\n", nodesName); - REQUIRE(sch.size() == 10 + orderedInputs.size()); + CHECK(sch.size() == nb_nodes + orderedInputs.size()); } }