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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            arojas Alexander Rojas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment