MockSupport* MockSupport::clone(const SimpleString& mockName) { MockSupport* newMock = new MockSupport(mockName); newMock->setMockFailureStandardReporter(standardReporter_); if (ignoreOtherCalls_) newMock->ignoreOtherCalls(); if (!enabled_) newMock->disable(); if (strictOrdering_) newMock->strictOrder(); newMock->tracing(tracing_); newMock->installComparatorsAndCopiers(comparatorsAndCopiersRepository_); return newMock; }
MockSupport* MockSupport::getMockSupportScope(const SimpleString& name) { SimpleString mockingSupportName = MOCK_SUPPORT_SCOPE_PREFIX; mockingSupportName += name; if (hasData(mockingSupportName)) { STRCMP_EQUAL("MockSupport", getData(mockingSupportName).getType().asCharString()); return (MockSupport*) getData(mockingSupportName).getObjectPointer(); } MockSupport *newMock = new MockSupport; newMock->setMockFailureReporter(reporter_); if (ignoreOtherCalls_) newMock->ignoreOtherCalls(); if (!enabled_) newMock->disable(); newMock->tracing(tracing_); newMock->installComparators(comparatorRepository_); setDataObject(mockingSupportName, "MockSupport", newMock); return newMock; }