Added test case for recursive variadic template specialization

This commit is contained in:
Bartek Kryza
2022-08-07 23:09:44 +02:00
parent 1844b992aa
commit ae7ef11e43
20 changed files with 416 additions and 130 deletions
@@ -41,16 +41,21 @@ void generator::generate_call(const message &m, std::ostream &ostr) const
const auto from = m_config.using_namespace().relative(m.from);
const auto to = m_config.using_namespace().relative(m.to);
if (from.empty() || to.empty()) {
LOG_DBG("Skipping empty call from '{}' to '{}'", from, to);
return;
}
auto message = m.message;
if (!message.empty())
message += "()";
ostr << '"' << from << "\" "
<< common::generators::plantuml::to_plantuml(message_t::kCall) << " \""
<< to << "\" : " << m.message << "()" << std::endl;
<< to << "\" : " << message << std::endl;
if (m.message == "add" && to == "A" && from == "A")
LOG_DBG("Generating call '{}' from {} [{}] to {} [{}]", m.message, from,
m.from_usr, to, m.to_usr);
else
LOG_DBG("Generating call '{}' from {} [{}] to {} [{}]", m.message, from,
m.from_usr, to, m.to_usr);
LOG_DBG("Generated call '{}' from {} [{}] to {} [{}]", message, from,
m.from_usr, to, m.to_usr);
}
void generator::generate_return(const message &m, std::ostream &ostr) const
@@ -71,11 +76,19 @@ void generator::generate_activity(const activity &a, std::ostream &ostr) const
{
for (const auto &m : a.messages) {
const auto to = m_config.using_namespace().relative(m.to);
if (to.empty())
continue;
generate_call(m, ostr);
ostr << "activate " << '"' << to << '"' << std::endl;
if (m_model.sequences.find(m.to_usr) != m_model.sequences.end())
generate_activity(m_model.sequences[m.to_usr], ostr);
generate_return(m, ostr);
ostr << "deactivate " << '"' << to << '"' << std::endl;
}
}