src/developer/forensics/feedback_data/tests/integrity_reporter_unittest.cc
// Get the integrity report for the provided annotations and attachments, check that it adheres to
// the schema, and turn it into a json document
Get the integrity report for the provided annotations and attachments, check that it adheres to
the schema, and turn it into a json document
Get the integrity report for the provided annotations and attachments check that it adheres to the schema and turn it into a json document
rapidjson::Document MakeJsonReport(const IntegrityReporter& reporter,
                                   const ::fit::result<Annotations>& annotations,
                                   const ::fit::result<Attachments>& attachments,
                                   const bool missing_non_platform_annotations = false) {
  const auto integrity_report =
      reporter.MakeIntegrityReport(annotations, attachments, missing_non_platform_annotations);
  FX_CHECK(integrity_report.has_value());
  rapidjson::Document json;
  FX_CHECK(!json.Parse(integrity_report.value().c_str()).HasParseError());
  rapidjson::Document schema_json;
  FX_CHECK(!schema_json.Parse(kIntegrityReportSchema).HasParseError());
  rapidjson::SchemaDocument schema(schema_json);
  rapidjson::SchemaValidator validator(schema);
  FX_CHECK(json.Accept(validator));
  return json;
}
rapidjson :: Document MakeJsonReport ( const IntegrityReporter & reporter , const :: fit :: result < Annotations > & annotations , const :: fit :: result < Attachments > & attachments , const bool missing_non_platform_annotations = false ) { const auto integrity_report = reporter . MakeIntegrityReport ( annotations , attachments , missing_non_platform_annotations ) ; FX_CHECK ( integrity_report . has_value ( ) ) ; rapidjson :: Document json ; FX_CHECK ( ! json . Parse ( integrity_report . value ( ) . c_str ( ) ) . HasParseError ( ) ) ; rapidjson :: Document schema_json ; FX_CHECK ( ! schema_json . Parse ( kIntegrityReportSchema ) . HasParseError ( ) ) ; rapidjson :: SchemaDocument schema ( schema_json ) ; rapidjson :: SchemaValidator validator ( schema ) ; FX_CHECK ( json . Accept ( validator ) ) ; return json ; }
Get the integrity report for the provided annotations and attachments, check that it adheres to
the schema, and turn it into a json document
Get the integrity report for the provided annotations and attachments check that it adheres to the schema and turn it into a json document