Skip to content

Commit 9fc4734

Browse files
committed
add optimize param checks
1 parent f6981d6 commit 9fc4734

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/test.data.table.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ gc_mem = function() {
364364
test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,notOutput=NULL,ignore.warning=NULL,options=NULL,env=NULL,optimize=NULL) {
365365
# if optimization is provided, test across multiple optimization levels
366366
if (!is.null(optimize)) {
367+
if (!is.numeric(optimize) || length(optimize) < 1L || anyNA(optimize) || any(optimize < 0L))
368+
stopf("optimize must be numeric, length >= 1, non-NA, and >= 0; got: %s", optimize)
367369
cl = match.call()
368370
cl$optimize= NULL # Remove optimization levels from the recursive call
369371

0 commit comments

Comments
 (0)