Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>2019-12-12 22:15:41 +0300
committerJordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>2019-12-12 22:15:41 +0300
commit5099e8fa3ea6d43fb0a20a47644437c6838af1aa (patch)
treee7a73a1aef6963b66f704f49b84c1830fd128653 /tests/notnull_tests.cpp
parent4f6f05d463780b94811d974426c1aef95b3db39b (diff)
removed string_view for string in tests
Diffstat (limited to 'tests/notnull_tests.cpp')
-rw-r--r--tests/notnull_tests.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp
index 4ad7f8d..1649ed6 100644
--- a/tests/notnull_tests.cpp
+++ b/tests/notnull_tests.cpp
@@ -53,7 +53,7 @@ struct fail_fast;
using namespace gsl;
namespace{
-constexpr std::string_view deathstring("Expected Death");
+static const std::string deathstring("Expected Death");
}
struct MyBase
@@ -182,7 +182,7 @@ TEST(notnull_tests, TestNotNullConstructors)
std::make_shared<int>(10)); // shared_ptr<int> is nullptr assignable
int* pi = nullptr;
- EXPECT_DEATH((not_null<decltype(pi)>(pi)), deathstring.data());
+ EXPECT_DEATH((not_null<decltype(pi)>(pi)), deathstring);
}
{
@@ -239,8 +239,8 @@ TEST(notnull_tests, TestNotNullConstructors)
{
// from returned pointer
- EXPECT_DEATH(helper(return_pointer()), deathstring.data());
- EXPECT_DEATH(helper_const(return_pointer()), deathstring.data());
+ EXPECT_DEATH(helper(return_pointer()), deathstring);
+ EXPECT_DEATH(helper_const(return_pointer()), deathstring);
}
}
@@ -310,7 +310,7 @@ TEST(notnull_tests, TestNotNullAssignment)
EXPECT_TRUE(helper(p));
int* q = nullptr;
- EXPECT_DEATH(p = not_null<int*>(q), deathstring.data());
+ EXPECT_DEATH(p = not_null<int*>(q), deathstring);
}
TEST(notnull_tests, TestNotNullRawPointerComparison)
@@ -469,7 +469,7 @@ TEST(notnull_tests, TestNotNullConstructorTypeDeduction)
int* p1 = nullptr;
const not_null x{p1};
};
- EXPECT_DEATH(workaround_macro(), deathstring.data());
+ EXPECT_DEATH(workaround_macro(), deathstring);
}
{
@@ -477,14 +477,14 @@ TEST(notnull_tests, TestNotNullConstructorTypeDeduction)
const int* p1 = nullptr;
const not_null x{p1};
};
- EXPECT_DEATH(workaround_macro(), deathstring.data());
+ EXPECT_DEATH(workaround_macro(), deathstring);
}
{
int* p = nullptr;
- EXPECT_DEATH(helper(not_null{p}), deathstring.data());
- EXPECT_DEATH(helper_const(not_null{p}), deathstring.data());
+ EXPECT_DEATH(helper(not_null{p}), deathstring);
+ EXPECT_DEATH(helper_const(not_null{p}), deathstring);
}
#ifdef CONFIRM_COMPILATION_ERRORS
@@ -531,7 +531,7 @@ TEST(notnull_tests, TestMakeNotNull)
const auto x = make_not_null(p1);
EXPECT_TRUE(*x == 42);
};
- EXPECT_DEATH(workaround_macro(), deathstring.data());
+ EXPECT_DEATH(workaround_macro(), deathstring);
}
{
@@ -540,21 +540,21 @@ TEST(notnull_tests, TestMakeNotNull)
const auto x = make_not_null(p1);
EXPECT_TRUE(*x == 42);
};
- EXPECT_DEATH(workaround_macro(), deathstring.data());
+ EXPECT_DEATH(workaround_macro(), deathstring);
}
{
int* p = nullptr;
- EXPECT_DEATH(helper(make_not_null(p)), deathstring.data());
- EXPECT_DEATH(helper_const(make_not_null(p)), deathstring.data());
+ EXPECT_DEATH(helper(make_not_null(p)), deathstring);
+ EXPECT_DEATH(helper_const(make_not_null(p)), deathstring);
}
#ifdef CONFIRM_COMPILATION_ERRORS
{
- EXPECT_DEATH(make_not_null(nullptr), deathstring.data());
- EXPECT_DEATH(helper(make_not_null(nullptr)), deathstring.data());
- EXPECT_DEATH(helper_const(make_not_null(nullptr)), deathstring.data());
+ EXPECT_DEATH(make_not_null(nullptr), deathstring);
+ EXPECT_DEATH(helper(make_not_null(nullptr)), deathstring);
+ EXPECT_DEATH(helper_const(make_not_null(nullptr)), deathstring);
}
#endif
}