Skip to content

Commit e2348d9

Browse files
committed
Skip integer overflow tests on CRAN
Add skip_on_cran() to two tests in tests/testthat/test-cpp_math_primitives.R (cpp_grouped_sums and cpp_multi_grouped_sums) so they are skipped during CRAN checks. These tests already skip on macOS and cover integer overflow/matrix-dimension edge cases that can cause false failures on CRAN.
1 parent 4589a07 commit e2348d9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tests/testthat/test-cpp_math_primitives.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ test_that("cpp_mean_squares handles larger matrices", {
625625
# ==============================================================================
626626

627627
test_that("cpp_grouped_sums triggers invalid matrix dimensions on integer overflow", {
628+
skip_on_cran()
628629
skip_on_os("mac")
629630
data_mat <- matrix(1.0, nrow = 1, ncol = 1)
630631
# R NA_integer_ is -2147483648, which underflows/overflows when processed in C++.
@@ -639,6 +640,7 @@ test_that("cpp_grouped_sums triggers invalid matrix dimensions on integer overfl
639640
})
640641

641642
test_that("cpp_multi_grouped_sums triggers invalid number of groups on integer overflow", {
643+
skip_on_cran()
642644
skip_on_os("mac")
643645
data_mat <- matrix(1.0, nrow = 1, ncol = 1)
644646
group_indices <- list(c(NA_integer_))

0 commit comments

Comments
 (0)