Menu

#21 Support for overloaded functions.

open
None
5
2005-04-25
2005-03-18
rgavrilov
No

Support for overloaded functions.

Discussion

  • Griffin Caprio

    Griffin Caprio - 2005-04-25

    Logged In: YES
    user_id=397472

    Could you provide some examples or a little more detail as to
    what you would like to see here?

    Thanks,

    Griffin

     
  • Griffin Caprio

    Griffin Caprio - 2005-04-25
    • assigned_to: nobody --> gcaprio
     
  • rgavrilov

    rgavrilov - 2005-05-05

    Logged In: YES
    user_id=1170022

    Consider I have two methods:
    Method(object obj);
    Method(ArrayList list);

    I want to ensure that Method(object) is being called with not
    null argument during test.

    mock.Expect("Method", new NotNull());

    will not work, since call: Method(new ArrayList()); will satisfy
    an expectation.

    1. It might be already fixed, since I have old release - if that's
    the case disregard this message.
    2. Solution 1: provide optional parameter (Type[]) that is
    required to be defined for overloaded methods.
    3. Solution 2: generate aliased functions for overloaded
    methods. E.g. Method_Object and Method_ArrayList.
    4. Guess method invoked at run-time based on arguments.

    Regards,
    Roman V. Gavrilov

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.