Add tests for R builds
This commit is contained in:
parent
69b268e6f7
commit
1de359f3e6
1 changed files with 505 additions and 0 deletions
10
test/testpkg/src/add.c
Normal file
10
test/testpkg/src/add.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <R.h>
|
||||
#include <Rinternals.h>
|
||||
|
||||
SEXP add(SEXP a, SEXP b)
|
||||
{
|
||||
SEXP result = PROTECT(allocVector(REALSXP, 1));
|
||||
REAL(result)[0] = asReal(a) + asReal(b);
|
||||
UNPROTECT(1);
|
||||
return result;
|
||||
}
|
||||
Loading…
Reference in a new issue