Skip to content

Commit d1392fa

Browse files
committed
unit test : update to use latest variant impl
1 parent 7e60981 commit d1392fa

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/unit.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,18 @@ TEST_CASE( "variant should correctly index types", "[variant]" ) {
208208
REQUIRE(variant_type(float(0.0)).get_type_index() == 0);
209209
}
210210

211-
TEST_CASE( "variant type traits", "[variant::detail]" ) {
211+
struct dummy {};
212+
213+
TEST_CASE( "variant value traits", "[variant::detail]" ) {
212214
// Users should not create variants with duplicated types
213215
// however our type indexing should still work
214216
// Index is in reverse order
215-
REQUIRE((util::detail::type_traits<bool, bool, int, double, std::string>::id == 3));
216-
REQUIRE((util::detail::type_traits<int, bool, int, double, std::string>::id == 2));
217-
REQUIRE((util::detail::type_traits<double, bool, int, double, std::string>::id == 1));
218-
REQUIRE((util::detail::type_traits<std::string, bool, int, double, std::string>::id == 0));
219-
REQUIRE((util::detail::type_traits<long, bool, int, double, std::string>::id == util::detail::invalid_value));
220-
REQUIRE((util::detail::type_traits<std::vector<int>, bool, int, double, std::string>::id == util::detail::invalid_value));
217+
REQUIRE((util::detail::value_traits<bool, bool, int, double, std::string>::index == 3));
218+
REQUIRE((util::detail::value_traits<int, bool, int, double, std::string>::index == 2));
219+
REQUIRE((util::detail::value_traits<double, bool, int, double, std::string>::index == 1));
220+
REQUIRE((util::detail::value_traits<std::string, bool, int, double, std::string>::index == 0));
221+
REQUIRE((util::detail::value_traits<dummy, bool, int, double, std::string>::index == util::detail::invalid_value));
222+
REQUIRE((util::detail::value_traits<std::vector<int>, bool, int, double, std::string>::index == util::detail::invalid_value));
221223
}
222224

223225
TEST_CASE( "variant default constructor", "variant()" ) {

0 commit comments

Comments
 (0)