Skip to content

Commit

Permalink
fix default ctor unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Jun 17, 2014
1 parent 7eb748e commit 03af9e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ TEST_CASE( "variant type traits", "[variant::detail]" ) {
REQUIRE((util::detail::type_traits<std::vector<int>, bool, int, double, std::string>::id == util::detail::invalid_value));
}


TEST_CASE( "variant default constructor", "variant()" ) {
// By default variant is initilised with (default constructed) first type in template parameters pack
// As a reusult first type in Types... must be defaul constructable
REQUIRE((util::variant<int, double, std::string>().get_type_index() == 0));
// NOTE: index in reverse order -> index = N - 1
REQUIRE((util::variant<int, double, std::string>().get_type_index() == 2));
}

int main (int argc, char* const argv[])
Expand Down

0 comments on commit 03af9e4

Please sign in to comment.