コード例 #1
0
	MockCheckedExpectedCall* addFunctionToExpectationsList(const SimpleString& name)
	{
		MockCheckedExpectedCall* newCall = new MockCheckedExpectedCall;
		newCall->withName(name);
		expectationsList->addExpectedCall(newCall);
		return newCall;
	}
コード例 #2
0
ファイル: MockSupport.cpp プロジェクト: Mindtribe/cpputest
void MockSupport::expectNoCall(const SimpleString& functionName)
{
    if (!enabled_) return;

    countCheck();

    MockCheckedExpectedCall* call = new MockCheckedExpectedCall;
    call->withName(appendScopeToName(functionName));
    unExpectations_.addExpectedCall(call);
}
コード例 #3
0
ファイル: MockSupport.cpp プロジェクト: dreadlock/cpputest
MockExpectedCall& MockSupport::expectOneCall(const SimpleString& functionName)
{
	if (!enabled_) return MockIgnoredExpectedCall::instance();

	MockCheckedExpectedCall* call = new MockCheckedExpectedCall;
	call->withName(functionName);
	if (strictOrdering_)
		call->withCallOrder(++expectedCallOrder_);
	expectations_.addExpectedCall(call);
	return *call;
}
コード例 #4
0
ファイル: MockFailureTest.cpp プロジェクト: Andne/cpputest
    void checkUnexpectedNthCallMessage(unsigned int count, const char* expectedOrdinal)
    {
        MockExpectedCallsList callList;
        MockCheckedExpectedCall expCall;

        expCall.withName("bar");
        for (unsigned int i = 0; i < (count - 1); i++) {
            expCall.callWasMade(1);
            callList.addExpectedCall(&expCall);
        }

        MockUnexpectedCallHappenedFailure failure(UtestShell::getCurrent(), "bar", callList);

        SimpleString expectedMessage = StringFromFormat("Mock Failure: Unexpected additional (%s) call to function: bar\n\tEXPECTED", expectedOrdinal);
        STRCMP_CONTAINS(expectedMessage.asCharString(), failure.getMessage().asCharString());
    }