Skip to content

Commit db68cba

Browse files
committed
Force default RNG Kind & RNG Normal in testing environment to be "Merseene-Twister" and "Inversion" (the defaults).
Switched from = to <- in file.
1 parent fceeff5 commit db68cba

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

inst/unitTests/runit.rmath.R

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if (.runThisTest) {
4343
msg = " rmath.qnorm")
4444

4545
set.seed(333)
46-
rcpp_result = runit_rnorm(a, b)
46+
rcpp_result <- runit_rnorm(a, b)
4747
set.seed(333)
4848

4949
checkEquals(rcpp_result,
@@ -71,7 +71,7 @@ if (.runThisTest) {
7171

7272

7373
set.seed(333)
74-
rcpp_result = runit_runif(a, b)
74+
rcpp_result <- runit_runif(a, b)
7575
set.seed(333)
7676

7777
checkEquals(rcpp_result,
@@ -98,7 +98,7 @@ if (.runThisTest) {
9898
msg = " rmath.qgamma")
9999

100100
set.seed(333)
101-
rcpp_result = runit_rgamma(a, b)
101+
rcpp_result <- runit_rgamma(a, b)
102102
set.seed(333)
103103

104104
checkEquals(rcpp_result,
@@ -125,7 +125,7 @@ if (.runThisTest) {
125125
msg = " rmath.qbeta")
126126

127127
set.seed(333)
128-
rcpp_result = runit_rbeta(a, b)
128+
rcpp_result <- runit_rbeta(a, b)
129129
set.seed(333)
130130

131131
checkEquals(rcpp_result,
@@ -153,7 +153,7 @@ if (.runThisTest) {
153153
msg = " rmath.qlnorm")
154154

155155
set.seed(333)
156-
rcpp_result = runit_rlnorm(a, b)
156+
rcpp_result <- runit_rlnorm(a, b)
157157
set.seed(333)
158158

159159
checkEquals(rcpp_result,
@@ -180,7 +180,7 @@ if (.runThisTest) {
180180
msg = " rmath.qchisq")
181181

182182
set.seed(333)
183-
rcpp_result = runit_rchisq(a)
183+
rcpp_result <- runit_rchisq(a)
184184
set.seed(333)
185185

186186
checkEquals(rcpp_result,
@@ -228,7 +228,7 @@ if (.runThisTest) {
228228
msg = " rmath.qf")
229229

230230
set.seed(333)
231-
rcpp_result = runit_rf(a, b)
231+
rcpp_result <- runit_rf(a, b)
232232
set.seed(333)
233233

234234
checkEquals(rcpp_result,
@@ -255,7 +255,7 @@ if (.runThisTest) {
255255
msg = " rmath.qt")
256256

257257
set.seed(333)
258-
rcpp_result = runit_rt(a)
258+
rcpp_result <- runit_rt(a)
259259
set.seed(333)
260260

261261
checkEquals(rcpp_result,
@@ -284,7 +284,7 @@ if (.runThisTest) {
284284
msg = " rmath.qbinom")
285285

286286
set.seed(333)
287-
rcpp_result = runit_rbinom(a, b)
287+
rcpp_result <- runit_rbinom(a, b)
288288
set.seed(333)
289289

290290
checkEquals(rcpp_result,
@@ -312,7 +312,7 @@ if (.runThisTest) {
312312
msg = " rmath.qcauchy")
313313

314314
set.seed(333)
315-
rcpp_result = runit_rcauchy(a, b)
315+
rcpp_result <- runit_rcauchy(a, b)
316316
set.seed(333)
317317

318318
checkEquals(rcpp_result,
@@ -339,7 +339,7 @@ if (.runThisTest) {
339339
msg = " rmath.qexp")
340340

341341
set.seed(333)
342-
rcpp_result = runit_rexp(a)
342+
rcpp_result <- runit_rexp(a)
343343
set.seed(333)
344344

345345
checkEquals(rcpp_result,
@@ -366,7 +366,7 @@ if (.runThisTest) {
366366
msg = " rmath.qgeom")
367367

368368
set.seed(333)
369-
rcpp_result = runit_rgeom(a)
369+
rcpp_result <- runit_rgeom(a)
370370
set.seed(333)
371371

372372
checkEquals(rcpp_result,
@@ -395,7 +395,7 @@ if (.runThisTest) {
395395
msg = " rmath.qhyper")
396396

397397
set.seed(333)
398-
rcpp_result = runit_rhyper(a, b, c)
398+
rcpp_result <- runit_rhyper(a, b, c)
399399
set.seed(333)
400400

401401
checkEquals(rcpp_result,
@@ -424,7 +424,7 @@ if (.runThisTest) {
424424
msg = " rmath.qnbinom")
425425

426426
set.seed(333)
427-
rcpp_result = runit_rnbinom(a, b)
427+
rcpp_result <- runit_rnbinom(a, b)
428428
set.seed(333)
429429

430430
checkEquals(rcpp_result,
@@ -452,7 +452,7 @@ if (.runThisTest) {
452452
msg = " rmath.qpois")
453453

454454
set.seed(333)
455-
rcpp_result = runit_rpois(a)
455+
rcpp_result <- runit_rpois(a)
456456
set.seed(333)
457457

458458
checkEquals(rcpp_result,
@@ -481,7 +481,7 @@ if (.runThisTest) {
481481
msg = " rmath.qweibull")
482482

483483
set.seed(333)
484-
rcpp_result = runit_rweibull(a, b)
484+
rcpp_result <- runit_rweibull(a, b)
485485
set.seed(333)
486486

487487
checkEquals(rcpp_result,
@@ -510,7 +510,7 @@ if (.runThisTest) {
510510
msg = " rmath.qlogis")
511511

512512
set.seed(333)
513-
rcpp_result = runit_rlogis(a, b)
513+
rcpp_result <- runit_rlogis(a, b)
514514
set.seed(333)
515515

516516
checkEquals(rcpp_result,
@@ -603,7 +603,7 @@ if (.runThisTest) {
603603

604604

605605
set.seed(333)
606-
rcpp_result = runit_rwilcox(a, b)
606+
rcpp_result <- runit_rwilcox(a, b)
607607
set.seed(333)
608608

609609
checkEquals(rcpp_result,

tests/doRUnit.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ stopifnot(require(Rcpp, quietly=TRUE))
3535
set.seed(42)
3636

3737
## Define tests
38-
testSuite <- defineTestSuite(name="Rcpp Unit Tests",
39-
dirs=system.file("unitTests", package = "Rcpp"),
38+
testSuite <- defineTestSuite(name = "Rcpp Unit Tests",
39+
dirs = system.file("unitTests", package = "Rcpp"),
40+
rngKind = "Mersenne-Twister",
41+
rngNormalKind = "Inversion",
4042
testFuncRegexp = "^[Tt]est.+")
4143

4244
## without this, we get (or used to get) unit test failures

0 commit comments

Comments
 (0)