Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-8991

`ObjectApprover::approved()` signature prevents it from being mockable

    XMLWordPrintableJSON

    Details

      Description

      The ObjectApprover::approved() method has the following signature:

      virtual Try<bool> approved(
            const Option<Object>& object) const noexcept = 0;
      

      This is unfortunate since it is impossible to mock a function in google mock with two qualifiers, which reduces the amount of tests we can perform.

      Moreover, the noexcept is not even needed in Mesos, since it does not use exception and it is compiled without exception support by default.

      The tricky situation here is that this is a public API so it would be tricky to replace since it will break backwards compatibility.
       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arojas Alexander Rojas
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: