Skip to content

Commit 58df934

Browse files
committed
Minor coverage tweaks
1 parent 24fe5fe commit 58df934

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2025-08-26 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/tinytest/test_misc.R: Add minimal test for EigenNbThreads()
4+
5+
* inst/include/RcppEigenWrap.h: Add #nocov comments
6+
17
2025-08-23 Dirk Eddelbuettel <edd@debian.org>
28

39
* .github/workflows/ci.yaml (jobs): Re-enable coverage

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: RcppEigen
22
Type: Package
33
Title: 'Rcpp' Integration for the 'Eigen' Templated Linear Algebra Library
4-
Version: 0.3.4.0.2
5-
Date: 2024-08-23
4+
Version: 0.3.4.0.2.1
5+
Date: 2025-08-26
66
Authors@R: c(person("Doug", "Bates", role = "aut",
77
comment = c(ORCID = "0000-0001-8316-9503")),
88
person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org",

inst/include/RcppEigenWrap.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
2-
//
1+
32
// RcppEigenWrap.h: Rcpp wrap methods for Eigen matrices, vectors and arrays
43
//
5-
// Copyright (C) 2011 - 2022 Douglas Bates, Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2011 - 2025 Douglas Bates, Dirk Eddelbuettel and Romain Francois
65
//
76
// This file is part of RcppEigen.
87
//
@@ -39,7 +38,7 @@ namespace Rcpp{
3938
bool needs_dim = T::ColsAtCompileTime != 1;
4039
R_xlen_t m = obj.rows(), n = obj.cols();
4140
if (needs_dim && (m > INT_MAX || n > INT_MAX)) {
42-
Rcpp::stop("array dimensions cannot exceed INT_MAX");
41+
Rcpp::stop("array dimensions cannot exceed INT_MAX"); // #nocov
4342
}
4443
R_xlen_t size = m * n;
4544
typename Eigen::internal::conditional<
@@ -50,13 +49,13 @@ namespace Rcpp{
5049
const T&>::type objCopy(obj);
5150
SEXP ans = PROTECT(::Rcpp::wrap(objCopy.data(),
5251
objCopy.data() + size));
53-
if (needs_dim) {
52+
if (needs_dim) { // #nocov start
5453
SEXP dd = PROTECT(::Rf_allocVector(INTSXP, 2));
5554
int *d = INTEGER(dd);
5655
d[0] = m;
5756
d[1] = n;
5857
::Rf_setAttrib(ans, R_DimSymbol, dd);
59-
UNPROTECT(1);
58+
UNPROTECT(1); // #nocov end
6059
}
6160
UNPROTECT(1);
6261
return ans;

inst/tinytest/test_misc.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/r -t
22
#
3-
# Copyright (C) 2021 Dirk Eddelbuettel
3+
# Copyright (C) 2021-2025 Dirk Eddelbuettel
44
#
55
# This file is part of RcppEigen
66
#
@@ -27,6 +27,8 @@ eig <- RcppEigen:::eigen_version(TRUE)
2727
expect_equal(class(eig), "integer")
2828
expect_equal(length(eig), 1L)
2929
expect_equal(class(RcppEigen:::Eigen_SSE()), "logical")
30+
nt <- RcppEigen:::EigenNbThreads()
31+
expect_true(nt >= 0)
3032

3133
## -- R/flags.R
3234
cxxflags <- RcppEigen:::RcppEigenCxxFlags()

0 commit comments

Comments
 (0)