From d029d19726ccb4ca3815300f661e7998f18ae24f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Thu, 14 Dec 2023 09:59:16 -0800 Subject: [PATCH] Fix variant test code for C++ 17 --- api/test/nostd/string_view_test.cc | 2 +- api/test/nostd/variant_test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/test/nostd/string_view_test.cc b/api/test/nostd/string_view_test.cc index c966c5c879..bbd5cb0648 100644 --- a/api/test/nostd/string_view_test.cc +++ b/api/test/nostd/string_view_test.cc @@ -71,7 +71,7 @@ TEST(StringViewTest, SubstrPortion) TEST(StringViewTest, SubstrOutOfRange) { string_view s = "abc123"; -#if __EXCEPTIONS || (defined(OPENTELEMETRY_STL_VERSION) && (OPENTELEMETRY_STL_VERSION >= 2020)) +#if __EXCEPTIONS || (defined(OPENTELEMETRY_STL_VERSION) && (OPENTELEMETRY_STL_VERSION >= 2017)) EXPECT_THROW((void)s.substr(10), std::out_of_range); #else EXPECT_DEATH({ s.substr(10); }, ""); diff --git a/api/test/nostd/variant_test.cc b/api/test/nostd/variant_test.cc index a996fb349c..a910106390 100644 --- a/api/test/nostd/variant_test.cc +++ b/api/test/nostd/variant_test.cc @@ -48,7 +48,7 @@ TEST(VariantTest, Get) EXPECT_EQ(nostd::get(w), 12); EXPECT_EQ(*nostd::get_if(&v), 12); EXPECT_EQ(nostd::get_if(&v), nullptr); -#if __EXCEPTIONS || (defined(OPENTELEMETRY_STL_VERSION) && (OPENTELEMETRY_STL_VERSION >= 2020)) +#if __EXCEPTIONS || (defined(OPENTELEMETRY_STL_VERSION) && (OPENTELEMETRY_STL_VERSION >= 2017)) EXPECT_THROW(nostd::get(w), nostd::bad_variant_access); #else EXPECT_DEATH({ nostd::get(w); }, "");