-
-
Notifications
You must be signed in to change notification settings - Fork 220
Tweak coverage #1435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tweak coverage #1435
Conversation
Enchufa2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments below.
| // This is used internally instead of Rf_eval() to make evaluation safer | ||
| inline SEXP Rcpp_eval_impl(SEXP expr, SEXP env) { | ||
| return Rcpp_fast_eval(expr, env); | ||
| inline SEXP Rcpp_eval_impl(SEXP expr, SEXP env) { // #nocov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we drop this and use Rcpp_fast_eval directly in the remaining spots?
|
|
||
| /* check if we can use a fast version */ | ||
| if( TYPEOF(x) == STRSXP && parent.size() == Rf_length(x) ){ | ||
| if( TYPEOF(x) == STRSXP && parent.size() == Rf_length(x) ){ // #nocov start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should design a test to check the other side of the branch instead?
| try{ | ||
| index = parent.offset(name) ; | ||
| parent[ index ] = rhs ; | ||
| parent[ index ] = rhs ; // #nocov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird. Does this mean that we don't have any test that doesn't throw here?
| /* We need to evaluate if it is a promise */ | ||
| if( TYPEOF(res) == PROMSXP){ | ||
| res = internal::Rcpp_eval_impl( res, env ) ; | ||
| res = internal::Rcpp_eval_impl( res, env ) ; // #nocov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is important enough to test it?
| typedef XPtr<class_Base> XP_Class ; | ||
| typedef Rcpp::XPtr<Rcpp::Module> XP ; | ||
| CppClass( SEXP x) : S4(x){}; | ||
| CppClass( SEXP x) : S4(x){}; // #nocov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should test instantiation from SEXP?
This PR updates #nocov tags for a number of R and C++ source files. Apart from one remaining 'function factory' function that confuses the coverage counting, this pushes the needle towards full coverage.
Checklist
R CMD checkstill passes all tests