Skip to content

Commit

Permalink
just ignore the whole new section for visual studio 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed May 26, 2019
1 parent 1d8052b commit 5854dcc
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/NewParseTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ template <class X> class objWrapper {
X val_;
};

// I think there is a bug with the is_assignable in visual studio 2015 it is fixed in later versions
// so this test will not compile in that compiler
#if !defined(_MSC_VER) || _MSC_VER >= 1910

static_assert(CLI::detail::is_direct_constructible<objWrapper<std::string>, std::string>::value,
Expand All @@ -296,14 +298,11 @@ TEST_F(TApp, stringWrapper) {
EXPECT_EQ(sWrapper.value(), "string test");
}

#endif

static_assert(CLI::detail::is_direct_constructible<objWrapper<double>, double>::value,
"double wrapper isn't properly assignable");
#if !defined(_MSC_VER) || _MSC_VER >= 1910

static_assert(!CLI::detail::is_direct_constructible<objWrapper<double>, int>::value,
"double wrapper can be assigned from int");
#endif

static_assert(!CLI::detail::is_istreamable<objWrapper<double>>::value,
"double wrapper is input streamable and it shouldn't be");
Expand All @@ -325,11 +324,9 @@ TEST_F(TApp, doubleWrapper) {
static_assert(CLI::detail::is_direct_constructible<objWrapper<int>, int>::value,
"int wrapper is not constructible from int64");

// Visual 2015 has some issues with this about converting constructors in this context
#if !defined(_MSC_VER) || _MSC_VER >= 1910
static_assert(!CLI::detail::is_direct_constructible<objWrapper<int>, double>::value,
"int wrapper is constructible from double");
#endif

static_assert(!CLI::detail::is_istreamable<objWrapper<int>>::value,
"int wrapper is input streamable and it shouldn't be");

Expand All @@ -345,7 +342,7 @@ TEST_F(TApp, intWrapper) {

EXPECT_THROW(run(), CLI::ConversionError);
}
#if !defined(_MSC_VER) || _MSC_VER >= 1910

static_assert(!CLI::detail::is_direct_constructible<objWrapper<float>, int>::value,
"float wrapper is constructible from int");
static_assert(!CLI::detail::is_direct_constructible<objWrapper<float>, double>::value,
Expand All @@ -354,8 +351,6 @@ static_assert(!CLI::detail::is_direct_constructible<objWrapper<float>, double>::
static_assert(!CLI::detail::is_istreamable<objWrapper<float>>::value,
"float wrapper is input streamable and it shouldn't be");

// I think there is a bug with the is_assignable in visual studio 2015 it is fixed in later versions
// so this test will not compile in that compiler
TEST_F(TApp, floatWrapper) {
objWrapper<float> iWrapper;
app.add_option<objWrapper<float>, float>("-v", iWrapper);
Expand Down

0 comments on commit 5854dcc

Please sign in to comment.