Forum OpenACS Development: Re: callbacks and plain parameters

Collapse
Posted by Dave Bauer on
Jim

This looks pretty good, but I really like to see patches, especially for a core function like this, to include an automated test for 1) the original functionality, to prove it still works, 2) the new functionality to prove that it doesn't work without the patch, and does work as expected with the patch.

This greatly reduces the effort required by code reviewers to understand what your patch is doing, and is a good way to learn how to add testing into your development.

Collapse
Posted by Jim Lynch on
Dave,

To clarify my reasoning for exposing the patch, Lee Denison had committed this to HEAD earlier (with a few other changes, like ... eq ... replacing [string equal ... ...]). What I did was take his patch and remove everything but the one thing that did the job.

If I understand correctly, feature adds to 5.2 are frozen. My intent was not to change 5.2 as shipped, but rather to provide folks running 5.2 with a working callback functionality if they personally wanted it; if so, they would apply the patch and restart their server.

To clarify what the patch does, it can be seen by looking at the patch itself: the else clause of that structure causes an argument parser to be built. The change adds an additional condition which must be satisfied to -not- build an argument parser: the ad_proc must not be defining a callback.

Collapse
Posted by Jim Lynch on
Aside from which.... isn't there already tests for (1)? :)