Skip to content

Commit 1554962

Browse files
authored
Merge pull request #20 from pachadotdev/roxygen
remove bits of other PRs
2 parents 215703f + 1099f5f commit 1554962

File tree

5 files changed

+7
-77
lines changed

5 files changed

+7
-77
lines changed

cpp11test/R/cpp11.R

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -160,57 +160,28 @@ notroxcpp1_ <- function(x) {
160160
.Call(`_cpp11test_notroxcpp1_`, x)
161161
}
162162

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

172-
#' @title Roxygenise C++ function III
173-
#' @param x numeric value
174-
#' @description Dummy function to test roxygen2. It adds 3.0 to a double.
175-
#' @export
176-
#' @examples roxcpp3_(1.0)
177167
roxcpp3_ <- function(x) {
178-
.Call(`_cpp11test_roxcpp3_`, x)
168+
.Call(`_cpp11test_roxcpp3_`, x)
179169
}
180170

181-
#' @title Roxygenise C++ function IV
182-
#' @param x numeric value
183-
#' @description Dummy function to test roxygen2. It adds 4.0 to a double.
184-
#' @export
185-
#' @examples roxcpp4_(1.0)
186171
roxcpp4_ <- function(x) {
187-
.Call(`_cpp11test_roxcpp4_`, x)
172+
.Call(`_cpp11test_roxcpp4_`, x)
188173
}
189174

190-
#' @title Roxygenise C++ function V
191-
#' @param x numeric value
192-
#' @description Dummy function to test roxygen2. It adds 5.0 to a double.
193-
#' @export
194-
#' @examples roxcpp5_(1.0)
195175
roxcpp5_ <- function(x) {
196-
.Call(`_cpp11test_roxcpp5_`, x)
176+
.Call(`_cpp11test_roxcpp5_`, x)
197177
}
198178

199179
notroxcpp6_ <- function(x) {
200180
.Call(`_cpp11test_notroxcpp6_`, x)
201181
}
202182

203-
#' @title Roxygenise C++ function VII
204-
#' @param x numeric value
205-
#' @description Dummy function to test roxygen2. It adds 7.0 to a double.
206-
#' @export
207-
#' @examples
208-
#' my_fun <- function(x) {
209-
#' roxcpp7_(x)
210-
#' }
211-
#' @seealso \code{\link{roxcpp1_}}
212183
roxcpp7_ <- function(x) {
213-
.Call(`_cpp11test_roxcpp7_`, x)
184+
.Call(`_cpp11test_roxcpp7_`, x)
214185
}
215186

216187
cpp11_safe_ <- function(x_sxp) {

cpp11test/src/cpp11.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ static const R_CallMethodDef CallEntries[] = {
603603
{"_cpp11test_my_warning_n1", (DL_FUNC) &_cpp11test_my_warning_n1, 1},
604604
{"_cpp11test_my_warning_n1fmt", (DL_FUNC) &_cpp11test_my_warning_n1fmt, 1},
605605
{"_cpp11test_my_warning_n2fmt", (DL_FUNC) &_cpp11test_my_warning_n2fmt, 2},
606+
{"_cpp11test_notroxcpp1_", (DL_FUNC) &_cpp11test_notroxcpp1_, 1},
607+
{"_cpp11test_notroxcpp6_", (DL_FUNC) &_cpp11test_notroxcpp6_, 1},
606608
{"_cpp11test_nullable_extptr_1", (DL_FUNC) &_cpp11test_nullable_extptr_1, 0},
607609
{"_cpp11test_nullable_extptr_2", (DL_FUNC) &_cpp11test_nullable_extptr_2, 0},
608610
{"_cpp11test_protect_many_", (DL_FUNC) &_cpp11test_protect_many_, 1},

cpp11test/src/test-doubles.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -455,22 +455,6 @@ context("doubles-C++") {
455455
expect_true(!cpp11::is_na(na2[1]));
456456
}
457457

458-
test_that("as_doubles(logicals)") {
459-
cpp11::writable::logicals y;
460-
461-
for (int i = 0; i < 4; i++) {
462-
y.push_back(i % 2 == 0);
463-
}
464-
465-
cpp11::doubles i(cpp11::as_doubles(y));
466-
467-
expect_true(i[0] == 1.0);
468-
expect_true(i[1] == 0.0);
469-
expect_true(i[2] == 1.0);
470-
expect_true(i[3] == 0.0);
471-
expect_true(cpp11::detail::r_typeof(i) == REALSXP);
472-
}
473-
474458
test_that("doubles operator[] and at") {
475459
cpp11::doubles x(Rf_allocVector(REALSXP, 2));
476460
REAL(x)[0] = 1;

cpp11test/src/test-integers.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,6 @@ context("integers-C++") {
4444
expect_true(!cpp11::is_na(na2[1]));
4545
}
4646

47-
test_that("as_integers(logicals)") {
48-
cpp11::writable::logicals y;
49-
50-
for (int i = 0; i < 4; i++) {
51-
y.push_back(i % 2 == 0);
52-
}
53-
54-
cpp11::integers i(cpp11::as_integers(y));
55-
56-
expect_true(i[0] == 1);
57-
expect_true(i[1] == 0);
58-
expect_true(i[2] == 1);
59-
expect_true(i[3] == 0);
60-
expect_true(cpp11::detail::r_typeof(i) == INTSXP);
61-
}
62-
6347
test_that("integers.push_back()") {
6448
cpp11::writable::integers x;
6549
x.push_back(1);

cpp11test/tests/testthat/test-external-pointer.R

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)