| 601 | } |
| 602 | |
| 603 | static MockValue_c getMockValueCFromNamedValue(const MockNamedValue& namedValue) |
| 604 | { |
| 605 | MockValue_c returnValue; |
| 606 | if (SimpleString::StrCmp(namedValue.getType().asCharString(), "bool") == 0) { |
| 607 | returnValue.type = MOCKVALUETYPE_BOOL; |
| 608 | returnValue.value.boolValue = namedValue.getBoolValue() ? 1 : 0; |
| 609 | } |
| 610 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "int") == 0) { |
| 611 | returnValue.type = MOCKVALUETYPE_INTEGER; |
| 612 | returnValue.value.intValue = namedValue.getIntValue(); |
| 613 | } |
| 614 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "unsigned int") == 0) { |
| 615 | returnValue.type = MOCKVALUETYPE_UNSIGNED_INTEGER; |
| 616 | returnValue.value.unsignedIntValue = namedValue.getUnsignedIntValue(); |
| 617 | } |
| 618 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "long int") == 0) { |
| 619 | returnValue.type = MOCKVALUETYPE_LONG_INTEGER; |
| 620 | returnValue.value.longIntValue = namedValue.getLongIntValue(); |
| 621 | } |
| 622 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "unsigned long int") == 0) { |
| 623 | returnValue.type = MOCKVALUETYPE_UNSIGNED_LONG_INTEGER; |
| 624 | returnValue.value.unsignedLongIntValue = namedValue.getUnsignedLongIntValue(); |
| 625 | } |
| 626 | #ifdef CPPUTEST_USE_LONG_LONG |
| 627 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "long long int") == 0) { |
| 628 | returnValue.type = MOCKVALUETYPE_LONG_LONG_INTEGER; |
| 629 | returnValue.value.longLongIntValue = namedValue.getLongLongIntValue(); |
| 630 | } |
| 631 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "unsigned long long int") == 0) { |
| 632 | returnValue.type = MOCKVALUETYPE_UNSIGNED_LONG_LONG_INTEGER; |
| 633 | returnValue.value.unsignedLongLongIntValue = namedValue.getUnsignedLongLongIntValue(); |
| 634 | } |
| 635 | #endif |
| 636 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "double") == 0) { |
| 637 | returnValue.type = MOCKVALUETYPE_DOUBLE; |
| 638 | returnValue.value.doubleValue = namedValue.getDoubleValue(); |
| 639 | } |
| 640 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "const char*") == 0) { |
| 641 | returnValue.type = MOCKVALUETYPE_STRING; |
| 642 | returnValue.value.stringValue = namedValue.getStringValue(); |
| 643 | } |
| 644 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "void*") == 0) { |
| 645 | returnValue.type = MOCKVALUETYPE_POINTER; |
| 646 | returnValue.value.pointerValue = namedValue.getPointerValue(); |
| 647 | } |
| 648 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "const void*") == 0) { |
| 649 | returnValue.type = MOCKVALUETYPE_CONST_POINTER; |
| 650 | returnValue.value.constPointerValue = namedValue.getConstPointerValue(); |
| 651 | } |
| 652 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "void (*)()") == 0) { |
| 653 | returnValue.type = MOCKVALUETYPE_FUNCTIONPOINTER; |
| 654 | returnValue.value.functionPointerValue = (void (*)()) namedValue.getFunctionPointerValue(); |
| 655 | } |
| 656 | else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "const unsigned char*") == 0) { |
| 657 | returnValue.type = MOCKVALUETYPE_MEMORYBUFFER; |
| 658 | returnValue.value.memoryBufferValue = namedValue.getMemoryBuffer(); |
| 659 | } |
| 660 | else { |
no test coverage detected