Hi Alon,
Please Find the code of getCalculatedStr() function it returns CString type and method type is a const (inspector) Basically I am trying to Mock this method it returns the error that can't fake return types of CString
Assert failed. The function 'pressureRateClass::getCalculatedStr' returns by value (type is 'ATL::CStringT'). However Isolator++ cannot fake it since its default constructor couldn't be found.
CString pressureRateClass::getCalculatedStr() const
{
CString rtnString;
double input{}, output{};
int display{}, storage{};
CString formatStr;
if (dataPtr == nullptr && floatDataPtr == nullptr)
{
rtnString = "N/A";
return (rtnString);
}
display = unit.GetDisplayUnits();
storage = unit.GetStorageUnits();
if (floatDataPtr)
{
input = (double)multi * *floatDataPtr;
if ((input <= (FRAME_DATA_NOT_AVAILABLE + 1.0)) && (input >= (FRAME_DATA_NOT_AVAILABLE - 1.0))) return ("N/A");
}
else
{
input = (double)multi * *dataPtr;
if ((input <= (FRAME_DATA_NOT_AVAILABLE + 1.0)) && (input >= (FRAME_DATA_NOT_AVAILABLE - 1.0)))
return ("N/A"); // FRAME_DATA_NOT_AVAILABLE is a negitive value.
}
unit.ConvertValue(storage, input, display, output);
// rtnString.Format ("%8.4g %s", output, unit.GetUnitName());
formatStr = unit.GetUnitFormat(DISPLAY_UNITS, FORMAT_WIDTH);
formatStr += " %s";
rtnString.Format(formatStr, output, (const char*)unit.GetUnitName());
// GetUnitName defaults to display variable
return rtnString;
}