Add GenIdentity, an identity function for MappedShuffle.

We use this function in z_sendmany as part of the fix for #1779.
This commit is contained in:
Simon
2016-11-05 14:12:41 -07:00
parent 7c463780cf
commit 38276c6ba2
5 changed files with 24 additions and 6 deletions

View File

@@ -24,4 +24,12 @@ TEST(Random, MappedShuffle) {
std::vector<int> em2 {0, 1, 2, 3, 4};
EXPECT_EQ(ea2, a2);
EXPECT_EQ(em2, m2);
auto a3 = a;
auto m3 = m;
MappedShuffle(a3.begin(), m3.begin(), a3.size(), GenIdentity);
std::vector<int> ea3 {8, 4, 6, 3, 5};
std::vector<int> em3 {0, 1, 2, 3, 4};
EXPECT_EQ(ea3, a3);
EXPECT_EQ(em3, m3);
}