I've following method:
QMap<QString, int> DefaultConfig::getConfig()
{
QMap<QString, int> result;
result.insert("Error", LOG_LOCAL0);
result.insert("Application", LOG_LOCAL1);
result.insert("System", LOG_LOCAL2);
result.insert("Debug", LOG_LOCAL3);
result.insert("Trace", LOG_LOCAL4);
return result;
}
an I try to write mock which can return QMap prepared in test:
QMap<QString, int> DefaultConfig::getConfig() {
mock().actualCall("getConfig");
return ?
}
but I don't know how to mock the return value? I would like to use the mock in following way in TEST
function:
QMap<QString, int> fake_map;
fake_map.insert("ABC", 1);
mock().expectOneCall("getConfig").andReturnValue(fake_map);
I cannot find such example in CppUTest Mocking documentation. I also know that .andReturnValue
in this form will also not work.