Skip to content

Commit

Permalink
Removed test case.
Browse files Browse the repository at this point in the history
After the changes to it, this test doesn't test any more what it was supposed to test (that implicit conversion is done to first convertible type and not first type that can hold the value). So it can be removed now because it tests the same thing as the test above it.
  • Loading branch information
joto committed Jun 27, 2014
1 parent 8b6c0b3 commit 08a7e04
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions test/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,6 @@ TEST_CASE( "implicit conversion to unsigned char", "[variant][implicit conversio

struct dummy {};

TEST_CASE( "implicit conversion to first type it can convert to even if it doesn't fit", "[variant][implicit conversion]" ) {
typedef util::variant<dummy, unsigned char, long> variant_type;
variant_type var = 100.0; // converted to unsigned char, even if it doesn't fit
REQUIRE(var.get<unsigned char>() == static_cast<unsigned char>(100.0));
REQUIRE_THROWS(var.get<long>());
var = 100; // int converted to unsigned char, even if it doesn't fit
REQUIRE(var.get<unsigned char>() == static_cast<unsigned char>(100));
REQUIRE_THROWS(var.get<long>());
var = 100L; // explicit long is okay
REQUIRE(var.get<long>() == 100L);
REQUIRE_THROWS(var.get<char>());
}

TEST_CASE( "variant value traits", "[variant::detail]" ) {
// Users should not create variants with duplicated types
// however our type indexing should still work
Expand Down

1 comment on commit 08a7e04

@springmeyer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.