Example #1
0
SimpleString MockCheckedExpectedCall::callToString()
{
    SimpleString str;
    if (objectPtr_)
        str = StringFromFormat("(object address: %p)::", objectPtr_);

    str += getName();
    str += " -> ";
    if (expectedCallOrder_ != NO_EXPECTED_CALL_ORDER) {
        str += StringFromFormat("expected call order: <%d> -> ", expectedCallOrder_);
    }

    if (inputParameters_->begin() == NULL && outputParameters_->begin() == NULL) {
        str += (ignoreOtherParameters_) ? "all parameters ignored" : "no parameters";
        return str;
    }

	MockNamedValueListNode* p;

    for (p = inputParameters_->begin(); p; p = p->next()) {
        str += StringFromFormat("%s %s: <%s>", p->getType().asCharString(), p->getName().asCharString(), getInputParameterValueString(p->getName()).asCharString());
        if (p->next()) str += ", ";
    }

    for (p = outputParameters_->begin(); p; p = p->next()) {
        str += StringFromFormat("%s %s: <output>", p->getType().asCharString(), p->getName().asCharString());
        if (p->next()) str += ", ";
    }

    if (ignoreOtherParameters_)
        str += ", other parameters are ignored";
    return str;
}
Example #2
0
SimpleString MockCheckedExpectedCall::missingParametersToString()
{
    SimpleString str;
    MockNamedValueListNode* p;

    for (p = inputParameters_->begin(); p; p = p->next()) {
        if (! item(p)->isMatchingActualCall()) {
            if (str != "") str += ", ";
            str += StringFromFormat("%s %s", p->getType().asCharString(), p->getName().asCharString());
        }
    }
    for (p = outputParameters_->begin(); p; p = p->next()) {
        if (! item(p)->isMatchingActualCall()) {
            if (str != "") str += ", ";
            str += StringFromFormat("%s %s", p->getType().asCharString(), p->getName().asCharString());
        }
    }
    return str;
}
SimpleString MockExpectedFunctionCall::missingParametersToString()
{
	SimpleString str;
	for (MockNamedValueListNode* p = parameters_->begin(); p; p = p->next()) {
		if (! item(p)->isFulfilled()) {
			if (str != "") str += ", ";
			str += StringFromFormat("%s %s", p->getType().asCharString(), p->getName().asCharString());
		}
	}
	return str;
}