mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 14:09:26 +00:00
Made ITestCase a shared object
This commit is contained in:
parent
a67d833091
commit
9c6ce97f01
6 changed files with 19 additions and 79 deletions
|
@ -33,7 +33,7 @@
|
|||
|
||||
namespace Catch {
|
||||
|
||||
class OcMethod : public ITestCase {
|
||||
class OcMethod : public SharedImpl<ITestCase> {
|
||||
|
||||
public:
|
||||
OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
|
||||
|
@ -47,22 +47,9 @@ namespace Catch {
|
|||
|
||||
arcSafeRelease( obj );
|
||||
}
|
||||
|
||||
virtual ITestCase* clone() const {
|
||||
return new OcMethod( m_cls, m_sel );
|
||||
}
|
||||
|
||||
virtual bool operator == ( const ITestCase& other ) const {
|
||||
const OcMethod* ocmOther = dynamic_cast<const OcMethod*> ( &other );
|
||||
return ocmOther && ocmOther->m_sel == m_sel;
|
||||
}
|
||||
|
||||
virtual bool operator < ( const ITestCase& other ) const {
|
||||
const OcMethod* ocmOther = dynamic_cast<const OcMethod*> ( &other );
|
||||
return ocmOther && ocmOther->m_sel < m_sel;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~OcMethod() {}
|
||||
|
||||
Class m_cls;
|
||||
SEL m_sel;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue