Fixed testClass unit tests

release/4.3a0
dellaert 2014-12-01 20:34:05 +01:00
parent aceeb2037b
commit 78b1cd271a
1 changed files with 12 additions and 3 deletions

View File

@ -43,12 +43,21 @@ TEST( Class, OverloadingMethod ) {
cls.addMethod(verbose, is_const, name, args, retVal, tmplate);
EXPECT_LONGS_EQUAL(1, cls.nrMethods());
EXPECT(cls.exists(name));
Method method = cls.method(name);
EXPECT_LONGS_EQUAL(1, method.nrOverloads());
EXPECT_LONGS_EQUAL(1, cls.method(name).nrOverloads());
// add an overload w different argument list
args.push_back(Argument(Qualified("Vector",Qualified::EIGEN),"v"));
cls.addMethod(verbose, is_const, name, args, retVal, tmplate);
EXPECT_LONGS_EQUAL(1, cls.nrMethods());
EXPECT_LONGS_EQUAL(2, method.nrOverloads());
EXPECT_LONGS_EQUAL(2, cls.method(name).nrOverloads());
// add with non-trivial template list, will create two different functions
boost::optional<Template> t = //
CreateTemplate("template<T = {Point2, Point3}>");
CHECK(t);
cls.addMethod(verbose, is_const, name, args, retVal, *t);
EXPECT_LONGS_EQUAL(3, cls.nrMethods());
EXPECT_LONGS_EQUAL(2, cls.method(name).nrOverloads());
}
/* ************************************************************************* */