more r tests
This commit is contained in:
parent
aab9c9843c
commit
a88995a11d
4 changed files with 187 additions and 0 deletions
52
Examples/test-suite/r/template_class_reuse_name_runme.R
Normal file
52
Examples/test-suite/r/template_class_reuse_name_runme.R
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
clargs <- commandArgs(trailing=TRUE)
|
||||
source(file.path(clargs[1], "unittest.R"))
|
||||
#source("unittest.R")
|
||||
|
||||
dyn.load(paste("template_class_reuse_name", .Platform$dynlib.ext, sep=""))
|
||||
source("template_class_reuse_name.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Bool1()$tt()
|
||||
Bool1False()$ff()
|
||||
|
||||
Bool2()$tt()
|
||||
Bool2False()$ff()
|
||||
|
||||
Bool3()$tt()
|
||||
Bool3False()$ff()
|
||||
|
||||
Bool4()$tt()
|
||||
Bool4False()$ff()
|
||||
|
||||
|
||||
BoolForward1()$tt()
|
||||
BoolForward1False()$ff()
|
||||
|
||||
BoolForward2()$tt()
|
||||
BoolForward2False()$ff()
|
||||
|
||||
BoolForward3()$tt()
|
||||
BoolForward3False()$ff()
|
||||
|
||||
BoolForward4()$tt()
|
||||
BoolForward4False()$ff()
|
||||
|
||||
|
||||
IntBool1()$tt()
|
||||
IntBool1False()$ff()
|
||||
|
||||
IntBool2()$tt()
|
||||
IntBool2False()$ff()
|
||||
|
||||
IntBool3()$tt()
|
||||
IntBool3False()$ff()
|
||||
|
||||
IntBool4()$tt()
|
||||
IntBool4False()$ff()
|
||||
|
||||
Duplicate2_0_n(Duplicate2_0())
|
||||
Duplicate3_n(Duplicate3())
|
||||
57
Examples/test-suite/r/template_classes_runme.R
Normal file
57
Examples/test-suite/r/template_classes_runme.R
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
clargs <- commandArgs(trailing=TRUE)
|
||||
source(file.path(clargs[1], "unittest.R"))
|
||||
#source("unittest.R")
|
||||
|
||||
dyn.load(paste("template_classes", .Platform$dynlib.ext, sep=""))
|
||||
source("template_classes.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
|
||||
# This test is just testing incorrect number of arguments/parameters checking
|
||||
|
||||
point = PointInt()
|
||||
rectangle = RectangleInt()
|
||||
|
||||
p = RectangleInt_getPoint(rectangle)
|
||||
unittest(PointInt_getX(p), 0)
|
||||
|
||||
RectangleInt_setPoint(rectangle, point)
|
||||
|
||||
unittest(RectangleInt_static_noargs(), 0)
|
||||
unittest(RectangleInt_static_onearg(12), 12)
|
||||
|
||||
|
||||
argCheckFailed = F
|
||||
try({
|
||||
RectangleInt_setPoint(rectangle)
|
||||
argCheckFailed = T
|
||||
}, silent=T)
|
||||
unittest(argCheckFailed, F)
|
||||
|
||||
|
||||
argCheckFailed = F
|
||||
try({
|
||||
RectangleInt_getPoint(rectangle, 0, .copy = F)
|
||||
argCheckFailed = T
|
||||
}, silent=T)
|
||||
unittest(argCheckFailed, F)
|
||||
|
||||
|
||||
argCheckFailed = F
|
||||
try({
|
||||
RectangleInt_static_noargs(123, .copy = F)
|
||||
argCheckFailed = T
|
||||
}, silent=T)
|
||||
unittest(argCheckFailed, F)
|
||||
|
||||
|
||||
|
||||
argCheckFailed = F
|
||||
try({
|
||||
RectangleInt_static_onearg()
|
||||
argCheckFailed = T
|
||||
}, silent=T)
|
||||
unittest(argCheckFailed, F)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
clargs <- commandArgs(trailing=TRUE)
|
||||
source(file.path(clargs[1], "unittest.R"))
|
||||
#source("unittest.R")
|
||||
|
||||
dyn.load(paste("template_default_arg_overloaded_extend", .Platform$dynlib.ext, sep=""))
|
||||
source("template_default_arg_overloaded_extend.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
|
||||
|
||||
|
||||
rs = ResultSet()
|
||||
|
||||
unittest(rs$go_get_method(0, SearchPoint()), -1)
|
||||
unittest(rs$go_get_method(0, SearchPoint(), 100), 100)
|
||||
|
||||
unittest(rs$go_get_template(0, SearchPoint()), -2)
|
||||
unittest(rs$go_get_template(0, SearchPoint(), 100), 100)
|
||||
|
||||
unittest(rs$over(), "over(int)")
|
||||
unittest(rs$over(10), "over(int)")
|
||||
unittest(rs$over(SearchPoint()), "over(giai2::SearchPoint, int)")
|
||||
unittest(rs$over(SearchPoint(), 10), "over(giai2::SearchPoint, int)")
|
||||
unittest(rs$over(T, SearchPoint()), "over(bool, gaia2::SearchPoint, int)")
|
||||
unittest(rs$over(T, SearchPoint(), 10), "over(bool, gaia2::SearchPoint, int)")
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
clargs <- commandArgs(trailing=TRUE)
|
||||
source(file.path(clargs[1], "unittest.R"))
|
||||
#source("unittest.R")
|
||||
|
||||
dyn.load(paste("template_default_arg_overloaded", .Platform$dynlib.ext, sep=""))
|
||||
source("template_default_arg_overloaded.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
|
||||
|
||||
|
||||
pl = PropertyList()
|
||||
unittest(1, pl$setInt("int", 10))
|
||||
unittest(1, pl$setInt("int", 10, F))
|
||||
|
||||
unittest(2, pl$set("int", pl))
|
||||
unittest(2, pl$set("int", pl, F))
|
||||
|
||||
unittest(3, pl$setInt("int", 10, "int"))
|
||||
unittest(3, pl$setInt("int", 10, "int", F))
|
||||
|
||||
|
||||
pl = PropertyListGlobal()
|
||||
unittest(1, pl$setIntGlobal("int", 10))
|
||||
unittest(1, pl$setIntGlobal("int", 10, F))
|
||||
|
||||
unittest(2, pl$set("int", pl))
|
||||
unittest(2, pl$set("int", pl, F))
|
||||
|
||||
unittest(3, pl$setIntGlobal("int", 10, "int"))
|
||||
unittest(3, pl$setIntGlobal("int", 10, "int", F))
|
||||
|
||||
|
||||
unittest(1, GoopIntGlobal(10))
|
||||
unittest(1, GoopIntGlobal(10, T))
|
||||
|
||||
unittest(2, goopGlobal(3))
|
||||
unittest(2, goopGlobal())
|
||||
|
||||
unittest(3, GoopIntGlobal("int", F))
|
||||
unittest(3, GoopIntGlobal("int"))
|
||||
|
||||
|
||||
unittest(1, GoopInt(10))
|
||||
unittest(1, GoopInt(10, T))
|
||||
|
||||
unittest(2, goop(3))
|
||||
unittest(2, goop())
|
||||
|
||||
unittest(3, GoopInt("int", F))
|
||||
unittest(3, GoopInt("int"))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue