Skip to content

Commit

Permalink
Add test for move construction into a named_type. See #336
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Mar 11, 2021
1 parent 61926d3 commit 39f9afc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions testsuite/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ unit_fwdpp_unit_tests_SOURCES=unit/fwdpp_unit_tests.cc unit/mutateTest.cc unit/g
unit/test_enum_bitflags.cc \
unit/test_nested_forward_lists.cc \
unit/test_validators.cc \
unit/test_named_type.cc \
fixtures/sugar_fixtures.cc \
fixtures/fwdpp_fixtures.hpp \
fixtures/sugar_fixtures.hpp \
Expand Down
16 changes: 16 additions & 0 deletions testsuite/unit/test_named_type.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <vector>
#include <boost/test/unit_test.hpp>
#include <fwdpp/util/named_type.hpp>

BOOST_AUTO_TEST_SUITE(test_named_type)

BOOST_AUTO_TEST_CASE(test_move_construction)
{
struct nt_tag{};
using vec = fwdpp::strong_types::named_type<std::vector<int>, nt_tag>;
std::vector<int> x{1,2,3,4,5,6};
vec v{std::move(x)};
BOOST_CHECK(x.empty());
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 39f9afc

Please sign in to comment.