import source from 1.3.40
[external/swig.git] / Examples / test-suite / r / r_legacy_runme.R
1 source("unittest.R")
2 dyn.load(paste("r_legacy", .Platform$dynlib.ext, sep=""))
3 source("r_legacy.R")
4 cacheMetaData(1)
5
6 obj <- getObject(1,3)
7 unittest(class(obj), "_p_Obj")
8 unittest(obj$i, 1)
9 unittesttol(obj$d, 3, 0.001)
10 unittest(obj$str, "a test string")
11 obj$i <- 2
12 unittest(obj$i, 2)
13 obj$d <- 4
14 unittesttol(obj$d, 4, 0.001)
15 obj$str <- "a new string"
16 unittest(obj$str, "a new string")
17
18 unittest(getInt(), 42)
19 unittesttol(getDouble(),3.14159, 0.001)
20 unittesttol(getFloat(),3.14159/2.0, 0.001)
21 unittest(getLong(), -321313)  
22 unittest(getUnsignedLong(), 23123)
23 unittest(getChar(), "A")
24
25 q(save="no")
26
27
28
29
30