The R Project SVN R

Rev

Rev 69945 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20124 ripley 1
#### STRICT test suite in the spirit of no-segfaults,
2
#### but with explicit statements.
3
 
4
options(error=expression(NULL))
5
stop("test of `options(error=expression(NULL))'")
6
 
7
if(FALSE) {
8
## these ought to work on machines with enough memory
9
## These segfaulted in 1.3.x ,  give "could not allocate" errors now
10
  integer(2^30+1)
11
   double(2^30+1)
12
  complex(2^30+1)
13
character(2^30+1)
14
vector("list", 2^30+2)
15
}
39826 maechler 16
 
42973 maechler 17
## bad infinite recursion / on.exit / ... interactions
70362 luke 18
##   catch the error to permit different error messages emitted
19
##   (handling of infinite recursion is different in the AST interpreter
20
##   and the byte-code interpreter)
21
 
69945 luke 22
bar <- function() 1+1
23
foo <- function() { on.exit(bar()); foo() }
70362 luke 24
tryCatch(foo(), error=function(x) TRUE) # now simple "infinite recursion"