Skip to content

Commit

Permalink
Add more tests for combine_ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadden committed Jul 11, 2018
1 parent 5f503df commit 77f9f35
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion unit_tests/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ TEST_CASE("captured_id", "[id]")
REQUIRE(boost::lexical_cast<std::string>(c) == "0");
}

TEST_CASE("id_pair", "[id]")
TEST_CASE("combine_ids x1", "[id]")
{
auto a = combine_ids(make_id(0));
auto b = combine_ids(make_id(1));
REQUIRE(boost::lexical_cast<std::string>(a) == "0");
REQUIRE(boost::lexical_cast<std::string>(b) == "1");
test_different_ids(a, b);
}

TEST_CASE("combine_ids x2", "[id]")
{
auto a = combine_ids(make_id(0), make_id(1));
auto b = combine_ids(make_id(1), make_id(2));
Expand All @@ -95,6 +104,20 @@ TEST_CASE("id_pair", "[id]")
test_different_ids(a, b);
}

TEST_CASE("combine_ids x3", "[id]")
{
auto a = combine_ids(make_id(0), make_id(1), make_id(2));
auto b = combine_ids(make_id(1), make_id(2), make_id(3));
test_different_ids(a, b);
}

TEST_CASE("combine_ids x4", "[id]")
{
auto a = combine_ids(make_id(0), make_id(1), make_id(2), make_id(3));
auto b = combine_ids(make_id(1), make_id(2), make_id(3), make_id(4));
test_different_ids(a, b);
}

TEST_CASE("clone_into", "[id]")
{
id_interface* storage = 0;
Expand Down

0 comments on commit 77f9f35

Please sign in to comment.