run test and copying typemaps to std::string

This commit is contained in:
Richard Beare 2016-04-05 10:06:42 +10:00
commit f7b794a4f3
3 changed files with 28 additions and 4 deletions

View file

@ -130,3 +130,13 @@ namespace aa {
std::vector< ::aa::Holder > vec1(std::vector< ::aa::Holder > x) { return x; }
%}
#endif
// exercising vectors of strings
%inline %{
std::vector<std::string> RevStringVec (const std::vector<std::string> &In)
{
std::vector<std::string> result(In);
std::reverse(result.begin(), result.end());
return(result);
}
%}

View file

@ -9,6 +9,10 @@ testvec <- c(1, 2, 3)
unittest(half(testvec), testvec/2)
unittest(average(testvec), mean(testvec))
## string vector test
vlen <- 13
stringvec <- paste(letters[1:vlen], as.character(rnorm(vlen)))
unittest(rev(stringvec), RevStringVec(stringvec))
q(save="no")