Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions cpp11test/R/cpp11.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,57 +160,28 @@ notroxcpp1_ <- function(x) {
.Call(`_cpp11test_notroxcpp1_`, x)
}

#' @title Roxygenise C++ function II
#' @param x numeric value
#' @description Dummy function to test roxygen2. It adds 2.0 to a double.
#' @export
#' @examples roxcpp2_(1.0)
roxcpp2_ <- function(x) {
.Call(`_cpp11test_roxcpp2_`, x)
.Call(`_cpp11test_roxcpp2_`, x)
}

#' @title Roxygenise C++ function III
#' @param x numeric value
#' @description Dummy function to test roxygen2. It adds 3.0 to a double.
#' @export
#' @examples roxcpp3_(1.0)
roxcpp3_ <- function(x) {
.Call(`_cpp11test_roxcpp3_`, x)
.Call(`_cpp11test_roxcpp3_`, x)
}

#' @title Roxygenise C++ function IV
#' @param x numeric value
#' @description Dummy function to test roxygen2. It adds 4.0 to a double.
#' @export
#' @examples roxcpp4_(1.0)
roxcpp4_ <- function(x) {
.Call(`_cpp11test_roxcpp4_`, x)
.Call(`_cpp11test_roxcpp4_`, x)
}

#' @title Roxygenise C++ function V
#' @param x numeric value
#' @description Dummy function to test roxygen2. It adds 5.0 to a double.
#' @export
#' @examples roxcpp5_(1.0)
roxcpp5_ <- function(x) {
.Call(`_cpp11test_roxcpp5_`, x)
.Call(`_cpp11test_roxcpp5_`, x)
}

notroxcpp6_ <- function(x) {
.Call(`_cpp11test_notroxcpp6_`, x)
}

#' @title Roxygenise C++ function VII
#' @param x numeric value
#' @description Dummy function to test roxygen2. It adds 7.0 to a double.
#' @export
#' @examples
#' my_fun <- function(x) {
#' roxcpp7_(x)
#' }
#' @seealso \code{\link{roxcpp1_}}
roxcpp7_ <- function(x) {
.Call(`_cpp11test_roxcpp7_`, x)
.Call(`_cpp11test_roxcpp7_`, x)
}

cpp11_safe_ <- function(x_sxp) {
Expand Down
2 changes: 2 additions & 0 deletions cpp11test/src/cpp11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ static const R_CallMethodDef CallEntries[] = {
{"_cpp11test_my_warning_n1", (DL_FUNC) &_cpp11test_my_warning_n1, 1},
{"_cpp11test_my_warning_n1fmt", (DL_FUNC) &_cpp11test_my_warning_n1fmt, 1},
{"_cpp11test_my_warning_n2fmt", (DL_FUNC) &_cpp11test_my_warning_n2fmt, 2},
{"_cpp11test_notroxcpp1_", (DL_FUNC) &_cpp11test_notroxcpp1_, 1},
{"_cpp11test_notroxcpp6_", (DL_FUNC) &_cpp11test_notroxcpp6_, 1},
{"_cpp11test_nullable_extptr_1", (DL_FUNC) &_cpp11test_nullable_extptr_1, 0},
{"_cpp11test_nullable_extptr_2", (DL_FUNC) &_cpp11test_nullable_extptr_2, 0},
{"_cpp11test_protect_many_", (DL_FUNC) &_cpp11test_protect_many_, 1},
Expand Down
16 changes: 0 additions & 16 deletions cpp11test/src/test-doubles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,22 +455,6 @@ context("doubles-C++") {
expect_true(!cpp11::is_na(na2[1]));
}

test_that("as_doubles(logicals)") {
cpp11::writable::logicals y;

for (int i = 0; i < 4; i++) {
y.push_back(i % 2 == 0);
}

cpp11::doubles i(cpp11::as_doubles(y));

expect_true(i[0] == 1.0);
expect_true(i[1] == 0.0);
expect_true(i[2] == 1.0);
expect_true(i[3] == 0.0);
expect_true(cpp11::detail::r_typeof(i) == REALSXP);
}

test_that("doubles operator[] and at") {
cpp11::doubles x(Rf_allocVector(REALSXP, 2));
REAL(x)[0] = 1;
Expand Down
16 changes: 0 additions & 16 deletions cpp11test/src/test-integers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ context("integers-C++") {
expect_true(!cpp11::is_na(na2[1]));
}

test_that("as_integers(logicals)") {
cpp11::writable::logicals y;

for (int i = 0; i < 4; i++) {
y.push_back(i % 2 == 0);
}

cpp11::integers i(cpp11::as_integers(y));

expect_true(i[0] == 1);
expect_true(i[1] == 0);
expect_true(i[2] == 1);
expect_true(i[3] == 0);
expect_true(cpp11::detail::r_typeof(i) == INTSXP);
}

test_that("integers.push_back()") {
cpp11::writable::integers x;
x.push_back(1);
Expand Down
11 changes: 0 additions & 11 deletions cpp11test/tests/testthat/test-external-pointer.R

This file was deleted.