| 54 | } |
| 55 | |
| 56 | SEXP maybeThrow(void* data) { |
| 57 | bool* fail = (bool*) data; |
| 58 | if (*fail) |
| 59 | (Rf_error)("throw!"); // prevent masking |
| 60 | else |
| 61 | return NumericVector::create(42); |
| 62 | } |
| 63 | |
| 64 | // [[Rcpp::export]] |
| 65 | SEXP testUnwindProtect(Environment indicator, bool fail) { |
no outgoing calls
no test coverage detected