Skip to content

Commit 63fb5a0

Browse files
committed
updates to testRcppModule
1 parent 886f5df commit 63fb5a0

File tree

10 files changed

+64
-13
lines changed

10 files changed

+64
-13
lines changed

ChangeLog

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
1+
2017-04-09 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/unitTests/testRcppModule/src/init.c (R_init_testRcppModule): Call
4+
R_registerRoutines() and R_useDynamicSymbols(); also ensure
5+
_rcpp_module_boot_* is registered for each module
6+
* inst/unitTests/testRcppModule/NAMESPACE: Added registration
7+
8+
* inst/unitTests/testRcppModule/DESCRIPTION (Title): Title case
9+
10+
* inst/unitTests/testRcppModule/R/rcpp_hello_world.R (rcpp_hello_world):
11+
Call the renamed C++ function
12+
* inst/unitTests/testRcppModule/src/rcpp_hello_world.cpp (rcpp_hello_world_cpp):
13+
Renamed C++ function to be distinct from R function calling it
14+
* inst/unitTests/testRcppModule/src/rcpp_hello_world.h: Ditto
15+
* inst/unitTests/testRcppModule/man/rcpp_hello_world.Rd: Alias renamed
16+
C++ function
17+
18+
* inst/unitTests/testRcppModule/man/Rcpp_modules_examples.Rd: Alias
19+
renamed modules
20+
* inst/unitTests/testRcppModule/tests/modules.R: Call renamed module
21+
122
2017-03-28 James J Balamuta <balamut2@illinois.edu>
223

324
* inst/vignettes/Rcpp-FAQ.Rnw: Added "Known Issues" section to FAQ
425

26+
2017-03-25 Dirk Eddelbuettel <edd@debian.org>
27+
28+
* LICENSE: Added
29+
* .Rbuildignore: Do not include LICENSE in package
30+
531
2017-03-17 Dirk Eddelbuettel <edd@debian.org>
632

733
* DESCRIPTION: Release 0.12.10

inst/unitTests/testRcppModule/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: testRcppModule
22
Type: Package
3-
Title: Some test examples using Rcpp with the Module feature
3+
Title: Some Test Examples using Rcpp with the Module Feature
44
Version: 0.1
55
Date: 2010-09-06
66
Author: John Chambers
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
useDynLib(testRcppModule)
1+
useDynLib(testRcppModule, .registration=TRUE)
22
exportPattern("^[[:alpha:]]+")
33
import(Rcpp,methods)
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
rcpp_hello_world <- function(){
3-
.Call( "rcpp_hello_world", PACKAGE = "testRcppModule" )
3+
.Call( "rcpp_hello_world_cpp", PACKAGE = "testRcppModule" )
44
}
55

inst/unitTests/testRcppModule/man/Rcpp_modules_examples.Rd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
\name{Rcpp Modules Examples}
2-
\alias{Num}
3-
\alias{World}
2+
\alias{RcppModuleNum}
3+
\alias{RcppModuleWorld}
44
\alias{bar}
55
\alias{bla}
66
\alias{bla1}
77
\alias{bla2}
88
\alias{foo}
99
\alias{vec}
1010
\alias{hello}
11-
\alias{Rcpp_Num-class}
12-
\alias{Rcpp_World-class}
11+
\alias{Rcpp_RcppModuleNum-class}
12+
\alias{Rcpp_RcppModuleWorld-class}
1313
\alias{Rcpp_vec-class}
1414
\alias{C++Object-class}
1515
\title{

inst/unitTests/testRcppModule/man/rcpp_hello_world.Rd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
\name{rcpp_hello_world}
22
\alias{rcpp_hello_world}
3+
\alias{rcpp_hello_world_cpp}
34
\docType{package}
45
\title{
56
Simple function using Rcpp
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <R.h>
2+
#include <Rinternals.h>
3+
#include <stdlib.h> // for NULL
4+
#include <R_ext/Rdynload.h>
5+
6+
/* FIXME:
7+
Check these declarations against the C/Fortran source code.
8+
*/
9+
10+
/* .Call calls */
11+
extern SEXP rcpp_hello_world_cpp();
12+
extern SEXP _rcpp_module_boot_RcppModuleNumEx();
13+
extern SEXP _rcpp_module_boot_RcppModuleWorld();
14+
extern SEXP _rcpp_module_boot_stdVector();
15+
16+
static const R_CallMethodDef CallEntries[] = {
17+
{"rcpp_hello_world_cpp", (DL_FUNC) &rcpp_hello_world_cpp, 0},
18+
{"_rcpp_module_boot_RcppModuleNumEx", (DL_FUNC) &_rcpp_module_boot_RcppModuleNumEx, 0},
19+
{"_rcpp_module_boot_RcppModuleWorld", (DL_FUNC) &_rcpp_module_boot_RcppModuleWorld, 0},
20+
{"_rcpp_module_boot_stdVector", (DL_FUNC) &_rcpp_module_boot_stdVector, 0},
21+
{NULL, NULL, 0}
22+
};
23+
24+
void R_init_testRcppModule(DllInfo *dll) {
25+
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
26+
R_useDynamicSymbols(dll, FALSE);
27+
}

inst/unitTests/testRcppModule/src/rcpp_hello_world.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "rcpp_hello_world.h"
22

3-
SEXP rcpp_hello_world(){
3+
SEXP rcpp_hello_world_cpp(){
44
using namespace Rcpp ;
55

66
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;

inst/unitTests/testRcppModule/src/rcpp_hello_world.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#include <Rcpp.h>
55

6-
RcppExport SEXP rcpp_hello_world() ;
6+
RcppExport SEXP rcpp_hello_world_cpp() ;
77

88
#endif

inst/unitTests/testRcppModule/tests/modules.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ stopifnot(all.equal(bar(2), 4))
1515
stopifnot(all.equal(foo(2,3), 6))
1616

1717
## properties (at one stage this seqfaulted, so beware)
18-
nn <- new(Num)
18+
nn <- new(RcppModuleNum)
1919
nn$x <- pi
2020
stopifnot(all.equal(nn$x, pi))
21-
22-
23-

0 commit comments

Comments
 (0)