From efa77339742553f8e226d443ffb8e439b34ff856 Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Thu, 22 Aug 2024 16:18:10 -0400 Subject: [PATCH] Conditonally run capabilities tests It seems that the toolchain on 3.6 Windows did not have these implemented yet --- cpp11test/src/test-r_vector.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cpp11test/src/test-r_vector.cpp b/cpp11test/src/test-r_vector.cpp index c50e0093..d138e998 100644 --- a/cpp11test/src/test-r_vector.cpp +++ b/cpp11test/src/test-r_vector.cpp @@ -6,7 +6,15 @@ #include // for max_element -context("r_vector-C++") { +#ifdef _WIN32 +#include "Rversion.h" +#define CPP11_HAS_IS_UTILITIES R_VERSION >= R_Version(4, 0, 0) +#else +#define CPP11_HAS_IS_UTILITIES 1 +#endif + +#if CPP11_HAS_IS_UTILITIES +context("r_vector-capabilities-C++") { test_that("read only vector capabilities") { using cpp11::integers; @@ -71,7 +79,10 @@ context("r_vector-C++") { expect_false(std::is_move_assignable::value); expect_false(std::is_trivially_move_assignable::value); } +} +#endif +context("r_vector-C++") { test_that("writable vector temporary isn't leaked (integer) (#338)") { R_xlen_t before = cpp11::detail::store::count();