Skip to content

Commit 99e1814

Browse files
committed
use move tests only if C++11 seen
1 parent 6ada570 commit 99e1814

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

ChangeLog

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
2022-05-25 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/tinytest/test_string.R: Add C++11 conditioning for new unit tests
4+
15
2022-05-23 Dean Scarff <[email protected]>
26

3-
* inst/include/Rcpp/String.h: Make less copies of strings by adding
4-
move semantics and preserving the buffer/SEXP representation when
5-
copying
7+
* inst/include/Rcpp/String.h: Make less copies of strings via move
8+
semantics and preserving the buffer/SEXP representation when copying
69
* inst/include/RcppCommon.h: include <utility> for std::move
710
* inst/tinytest/cpp/String.cpp: Add unit tests
811
* inst/tinytest/test_string.R: Add unit tests

inst/tinytest/test_string.R

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
## Copyright (C) 2012 - 2019 Dirk Eddelbuettel and Romain Francois
2+
## Copyright (C) 2012 - 2022 Dirk Eddelbuettel and Romain Francois
33
##
44
## This file is part of Rcpp.
55
##
@@ -63,21 +63,23 @@ expect_equal( res, target )
6363
res <- test_ctor("abc")
6464
expect_identical(res, "abc")
6565

66-
# test.String.move.ctor <- function() {
67-
res <- test_move_ctor()
68-
expect_identical(res, c("", "test"))
66+
if (Rcpp:::capabilities()[["Full C++11 support"]]) {
67+
## test.String.move.ctor <- function() {
68+
res <- test_move_ctor()
69+
expect_identical(res, c("", "test"))
6970

70-
# test.String.move.std.string.ctor <- function() {
71-
res <- test_move_std_string_ctor()
72-
expect_identical(res, "test")
71+
## test.String.move.std.string.ctor <- function() {
72+
res <- test_move_std_string_ctor()
73+
expect_identical(res, "test")
7374

74-
# test.String.move.assignment <- function() {
75-
res <- test_move_assignment()
76-
expect_identical(res, c("", "test"))
75+
## test.String.move.assignment <- function() {
76+
res <- test_move_assignment()
77+
expect_identical(res, c("", "test"))
7778

78-
# test.String.move.std.string.assignment <- function() {
79-
res <- test_move_std_string_assignment()
80-
expect_identical(res, "test")
79+
## test.String.move.std.string.assignment <- function() {
80+
res <- test_move_std_string_assignment()
81+
expect_identical(res, "test")
82+
}
8183

8284
# test.push.front <- function() {
8385
res <- test_push_front("def")

0 commit comments

Comments
 (0)