miraisolutions/rTRNG

Fix macOS test failures

riccardoporreca opened this issue · 2 comments

Revealed by the new GH Actions workflow for macOS-latest (oldrel) (3.6.3) => https://github.com/miraisolutions/rTRNG/runs/1765618265?check_suite_focus=true

[ FAIL 30 | WARN 0 | SKIP 0 | PASS 581 ]

All errors are of the form

 ── Failure (test-TRNG.Random.R:135:3): TRNGsplit errors for out-of-range subsequence indices ──
`TRNGsplit(p, p + 1L)` threw an error with unexpected class.
Expected class: std::invalid_argument
Actual class:   simpleError/error/condition
Message:        c++ exception (unknown reason)

and correspond to the current r-oldrel-macos-x86_64 for the released package version 4.20-1 on CRAN (in CRAN checks).

This reveals the approach in #10 (e4ac407) is not working on this platform and should be addressed differently.

This is most likely related to what described in RcppCore/Rcpp#972.

We need to work around the fact that, in certain circumstances (architectures / compilers), we cannot rely on errors propagating with proper std::invalid_argument class / error message.