本文整理汇总了C++中MockNamedValue::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ MockNamedValue::getType方法的具体用法?C++ MockNamedValue::getType怎么用?C++ MockNamedValue::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MockNamedValue
的用法示例。
在下文中一共展示了MockNamedValue::getType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MockFailure
MockUnexpectedOutputParameterFailure::MockUnexpectedOutputParameterFailure(UtestShell* test, const SimpleString& functionName, const MockNamedValue& parameter, const MockExpectedCallsList& expectations) : MockFailure(test)
{
MockExpectedCallsList expectationsForFunctionWithParameterName;
expectationsForFunctionWithParameterName.addExpectationsRelatedTo(functionName, expectations);
expectationsForFunctionWithParameterName.onlyKeepExpectationsWithOutputParameterName(parameter.getName());
if (expectationsForFunctionWithParameterName.isEmpty()) {
message_ = "Mock Failure: Unexpected output parameter name to function \"";
message_ += functionName;
message_ += "\": ";
message_ += parameter.getName();
}
else {
message_ = "Mock Failure: Unexpected parameter type \"";
message_ += parameter.getType();
message_ += "\" to output parameter \"";
message_ += parameter.getName();
message_ += "\" to function \"";
message_ += functionName;
message_ += "\"";
}
message_ += "\n";
addExpectationsAndCallHistoryRelatedTo(functionName, expectations);
message_ += "\n\tACTUAL unexpected output parameter passed to function: ";
message_ += functionName;
message_ += "\n";
message_ += "\t\t";
message_ += parameter.getType();
message_ += " ";
message_ += parameter.getName();
}
示例2: getMockValueCFromNamedValue
static MockValue_c getMockValueCFromNamedValue(const MockNamedValue& namedValue)
{
MockValue_c returnValue;
if (strcmp(namedValue.getType().asCharString(), "int") == 0) {
returnValue.type = MOCKVALUETYPE_INTEGER;
returnValue.value.intValue = namedValue.getIntValue();
}
else if (strcmp(namedValue.getType().asCharString(), "double") == 0) {
returnValue.type = MOCKVALUETYPE_DOUBLE;
returnValue.value.doubleValue = namedValue.getDoubleValue();
}
else if (strcmp(namedValue.getType().asCharString(), "char*") == 0) {
returnValue.type = MOCKVALUETYPE_STRING;
returnValue.value.stringValue = namedValue.getStringValue();
}
else if (strcmp(namedValue.getType().asCharString(), "void*") == 0) {
returnValue.type = MOCKVALUETYPE_POINTER;
returnValue.value.pointerValue = namedValue.getPointerValue();
}
else {
returnValue.type = MOCKVALUETYPE_OBJECT;
returnValue.value.objectValue = namedValue.getObjectPointer();
}
return returnValue;
}
示例3: finalizeOutputParameters
void MockCheckedActualCall::finalizeOutputParameters(MockCheckedExpectedCall* expectedCall)
{
for (MockOutputParametersListNode* p = outputParameterExpectations_; p; p = p->next_)
{
MockNamedValue outputParameter = expectedCall->getOutputParameter(p->name_);
MockNamedValueCopier* copier = outputParameter.getCopier();
if (copier)
{
copier->copy(p->ptr_, outputParameter.getObjectPointer());
}
else if ((outputParameter.getType() == "const void*") && (p->type_ == "void*"))
{
const void* data = outputParameter.getConstPointerValue();
size_t size = outputParameter.getSize();
PlatformSpecificMemCpy(p->ptr_, data, size);
}
else if (outputParameter.getName() != "")
{
SimpleString type = expectedCall->getOutputParameter(p->name_).getType();
MockNoWayToCopyCustomTypeFailure failure(getTest(), type);
failTest(failure);
}
}
}
示例4: getParameterType
SimpleString MockExpectedFunctionCall::getParameterType(const SimpleString& name)
{
MockNamedValue * p = parameters_->getValueByName(name);
return (p) ? p->getType() : "";
}
示例5: getInputParameterType
SimpleString MockCheckedExpectedCall::getInputParameterType(const SimpleString& name)
{
MockNamedValue * p = inputParameters_->getValueByName(name);
return (p) ? p->getType() : "";
}