Fixed some wrap unit tests that were left by the wayside
parent
9f0f745dc8
commit
2d654f7fa7
|
@ -36,6 +36,10 @@ public:
|
||||||
StaticMethod(verbose), is_const_(false) {
|
StaticMethod(verbose), is_const_(false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Method(const std::string& name, bool verbose = true) :
|
||||||
|
StaticMethod(name,verbose), is_const_(false) {
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool isStatic() const {
|
virtual bool isStatic() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ struct StaticMethod: public Function, public SignatureOverloads {
|
||||||
Function(verbosity) {
|
Function(verbosity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StaticMethod(const std::string& name, bool verbose = true) :
|
||||||
|
Function(name,verbose) {
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool isStatic() const {
|
virtual bool isStatic() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
%return_T(Point2 value) : returns gtsam::Point2
|
%return_T(Point2 value) : returns gtsam::Point2
|
||||||
%return_Tptr(Point2 value) : returns gtsam::Point2
|
%return_Tptr(Point2 value) : returns gtsam::Point2
|
||||||
%return_ptrs(Point2 p1, Point2 p2) : returns pair< gtsam::Point2, gtsam::Point2 >
|
%return_ptrs(Point2 p1, Point2 p2) : returns pair< gtsam::Point2, gtsam::Point2 >
|
||||||
%templatedMethod(Point2 t) : returns void
|
%templatedMethodPoint2(Point2 t) : returns void
|
||||||
%templatedMethod(Point3 t) : returns void
|
%templatedMethodPoint3(Point3 t) : returns void
|
||||||
%
|
%
|
||||||
classdef MyTemplatePoint2 < MyBase
|
classdef MyTemplatePoint2 < MyBase
|
||||||
properties
|
properties
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
%return_T(Point3 value) : returns gtsam::Point3
|
%return_T(Point3 value) : returns gtsam::Point3
|
||||||
%return_Tptr(Point3 value) : returns gtsam::Point3
|
%return_Tptr(Point3 value) : returns gtsam::Point3
|
||||||
%return_ptrs(Point3 p1, Point3 p2) : returns pair< gtsam::Point3, gtsam::Point3 >
|
%return_ptrs(Point3 p1, Point3 p2) : returns pair< gtsam::Point3, gtsam::Point3 >
|
||||||
%templatedMethod(Point2 t) : returns void
|
%templatedMethodPoint2(Point2 t) : returns void
|
||||||
%templatedMethod(Point3 t) : returns void
|
%templatedMethodPoint3(Point3 t) : returns void
|
||||||
%
|
%
|
||||||
classdef MyTemplatePoint3 < MyBase
|
classdef MyTemplatePoint3 < MyBase
|
||||||
properties
|
properties
|
||||||
|
|
|
@ -46,12 +46,12 @@ TEST( Class, OverloadingMethod ) {
|
||||||
EXPECT_LONGS_EQUAL(1, cls.nrMethods());
|
EXPECT_LONGS_EQUAL(1, cls.nrMethods());
|
||||||
EXPECT(cls.exists(name));
|
EXPECT(cls.exists(name));
|
||||||
Method& method = cls.method(name);
|
Method& method = cls.method(name);
|
||||||
EXPECT_LONGS_EQUAL(1, method.returnVals.size());
|
EXPECT_LONGS_EQUAL(1, method.nrOverloads());
|
||||||
|
|
||||||
cls.addMethod(verbose, is_const, name, args, retVal, templateArgName,
|
cls.addMethod(verbose, is_const, name, args, retVal, templateArgName,
|
||||||
templateArgValues);
|
templateArgValues);
|
||||||
EXPECT_LONGS_EQUAL(1, cls.nrMethods());
|
EXPECT_LONGS_EQUAL(1, cls.nrMethods());
|
||||||
EXPECT_LONGS_EQUAL(2, method.returnVals.size());
|
EXPECT_LONGS_EQUAL(2, method.nrOverloads());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -32,14 +32,12 @@ TEST( Method, Constructor ) {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
// addOverload
|
// addOverload
|
||||||
TEST( Method, addOverload ) {
|
TEST( Method, addOverload ) {
|
||||||
Method method;
|
Method method("myName");
|
||||||
method.name = "myName";
|
|
||||||
bool verbose = true, is_const = true;
|
bool verbose = true, is_const = true;
|
||||||
ArgumentList args;
|
ArgumentList args;
|
||||||
const ReturnValue retVal(ReturnType("return_type"));
|
const ReturnValue retVal(ReturnType("return_type"));
|
||||||
method.addOverload(verbose, is_const, "myName", args, retVal);
|
method.addOverload(verbose, is_const, "myName", args, retVal);
|
||||||
EXPECT_LONGS_EQUAL(1,method.argLists.size());
|
EXPECT_LONGS_EQUAL(1,method.nrOverloads());
|
||||||
EXPECT_LONGS_EQUAL(1,method.returnVals.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue