diff --git a/cpp11test/R/cpp11.R b/cpp11test/R/cpp11.R index 50aa4e5f..2ef90804 100644 --- a/cpp11test/R/cpp11.R +++ b/cpp11test/R/cpp11.R @@ -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) { diff --git a/cpp11test/src/cpp11.cpp b/cpp11test/src/cpp11.cpp index 71a5d443..9c58e190 100644 --- a/cpp11test/src/cpp11.cpp +++ b/cpp11test/src/cpp11.cpp @@ -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}, diff --git a/cpp11test/src/test-doubles.cpp b/cpp11test/src/test-doubles.cpp index 837103ee..9f5a5cfa 100644 --- a/cpp11test/src/test-doubles.cpp +++ b/cpp11test/src/test-doubles.cpp @@ -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; diff --git a/cpp11test/src/test-integers.cpp b/cpp11test/src/test-integers.cpp index 8caabdb6..6b144d75 100644 --- a/cpp11test/src/test-integers.cpp +++ b/cpp11test/src/test-integers.cpp @@ -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); diff --git a/cpp11test/tests/testthat/test-external-pointer.R b/cpp11test/tests/testthat/test-external-pointer.R deleted file mode 100644 index b82c6d80..00000000 --- a/cpp11test/tests/testthat/test-external-pointer.R +++ /dev/null @@ -1,11 +0,0 @@ -# Pacha: test that nullable external pointer is consistent (#312) -test_that("nullable external pointer is consistent", { - - len <- 1e5 - set.seed(42) - x <- rnorm(len) - sum_base <- sum(x) - - expect_equal(nullable_extptr_1(), NULL) - expect_equal(nullable_extptr_2(), NULL) -})