Skip to content

Commit

Permalink
graph_core_test: replace deprecated "std::random_shuffle"
Browse files Browse the repository at this point in the history
  • Loading branch information
jesec committed Jul 27, 2021
1 parent cb7a24a commit 590c92a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/tests/graph_core_test.cpp
Expand Up @@ -2,6 +2,7 @@

#include "graph_core.hpp"

#include <random>
#include <string>
#include <vector>

Expand Down Expand Up @@ -90,7 +91,7 @@ TEST_F(Setup_graph_core, trivial_ops_insert1) {
auto m = gc.create_node();
nodes.emplace_back(m);
}
std::random_shuffle(nodes.begin(), nodes.end());
std::shuffle(nodes.begin(), nodes.end(), std::knuth_b());

auto n=0u;
for(const auto &m:nodes) {
Expand Down Expand Up @@ -212,7 +213,7 @@ TEST_F(Setup_graph_core, delete_edge) {
auto m = gc.create_node();
nodes.emplace_back(m);
}
std::random_shuffle(nodes.begin(), nodes.end());
std::shuffle(nodes.begin(), nodes.end(), std::knuth_b());

std::vector<uint32_t> sink_nodes;
std::vector<uint32_t> driver_nodes;
Expand All @@ -230,8 +231,8 @@ TEST_F(Setup_graph_core, delete_edge) {
EXPECT_EQ(gc.get_num_pin_inputs (m1), driver_nodes.size());

#if 1
std::random_shuffle( sink_nodes.begin(), sink_nodes.end());
std::random_shuffle(driver_nodes.begin(), driver_nodes.end());
std::shuffle( sink_nodes.begin(), sink_nodes.end(), std::knuth_b());
std::shuffle(driver_nodes.begin(), driver_nodes.end(), std::knuth_b());

//gc.dump(m1);

Expand Down

0 comments on commit 590c92a

Please sign in to comment.