示例#1
0
bool metashell::data::operator==(const frame& a_, const frame& b_)
{
  return
    a_.name() == b_.name()
    && a_.is_full() == b_.is_full()
    && (!a_.is_full() ||
        (a_.kind() == b_.kind()
        // TODO commented out, because I don't want to include this information
        // into the UTs.
        /*&& a_.point_of_instantiation() == b_.point_of_instantiation()*/))
    && a_.is_profiled() == b_.is_profiled()
    && (!a_.is_profiled() ||
        (a_.time_taken() == b_.time_taken()
         && a_.time_taken_ratio() == b_.time_taken_ratio()));
}
示例#2
0
json_string metashell::system_test::to_json_string(const frame& f_)
{
  rapidjson::StringBuffer buff;
  rapidjson::Writer<rapidjson::StringBuffer> w(buff);

  w.StartObject();

  w.Key("type");
  w.String("frame");

  w.Key("name");
  w.String(f_.name().name().c_str());

  if (f_.has_kind())
  {
    w.Key("kind");
    const std::string kind = to_string(f_.kind());
    w.String(kind.c_str());
  }

  w.EndObject();

  return json_string(buff.GetString());
}