Skip to content

Commit 3340550

Browse files
committed
Conditonally run capabilities tests
It seems that the toolchain on 3.6 Windows did not have these implemented yet
1 parent 734603c commit 3340550

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cpp11test/src/test-r_vector.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66

77
#include <algorithm> // for max_element
88

9-
context("r_vector-C++") {
9+
#ifdef _WIN32
10+
#include "Rversion.h"
11+
#define CPP11_HAS_IS_UTILITIES R_VERSION >= R_Version(4, 0, 0)
12+
#else
13+
#define CPP11_HAS_IS_UTILITIES 1
14+
#endif
15+
16+
#if CPP11_HAS_IS_UTILITIES
17+
context("r_vector-capabilities-C++") {
1018
test_that("read only vector capabilities") {
1119
using cpp11::integers;
1220

@@ -71,7 +79,10 @@ context("r_vector-C++") {
7179
expect_false(std::is_move_assignable<integers::proxy>::value);
7280
expect_false(std::is_trivially_move_assignable<integers::proxy>::value);
7381
}
82+
}
83+
#endif
7484

85+
context("r_vector-C++") {
7586
test_that("writable vector temporary isn't leaked (integer) (#338)") {
7687
R_xlen_t before = cpp11::detail::store::count();
7788

0 commit comments

Comments
 (0)