Пример #1
0
MockSupport* MockSupport::clone()
{
    MockSupport* newMock = new MockSupport;
    newMock->setMockFailureStandardReporter(standardReporter_);
    if (ignoreOtherCalls_) newMock->ignoreOtherCalls();

    if (!enabled_) newMock->disable();

    if (strictOrdering_) newMock->strictOrder();

    newMock->tracing(tracing_);
    newMock->installComparators(comparatorRepository_);
    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;
}