void ClassTestSuite::testConstructorSearch() { Class test = Class::lookup("ClassTest::Test1"); Constructor defaultCons = test.findConstructor([](const Constructor& c) { return c.numberOfArguments() == 0; }); TS_ASSERT(defaultCons.isValid()); Constructor copyCons = test.findConstructor([](const Constructor& c) { return c.numberOfArguments() == 1 && c.argumentSpellings()[0] == "const ClassTest::Test1 &"; }); TS_ASSERT(copyCons.isValid()); }
void ClassTestSuite::testPrivateDestructor() { Class test = Class::lookup("ClassTest::Test2"); TS_ASSERT(test.isValid()); Constructor c = test.findConstructor([](const Constructor& c) { return c.isDefaultConstructor(); }); TS_ASSERT_THROWS_ANYTHING(c.call()); }