Code review comment for lp:~mvo/unity-scope-click/lp1292645-use-libclick

Revision history for this message
Alejandro J. Cura (alecu) wrote :

Hi mvo, thanks for working on this.

We can drop the tests that do the specific things that are now done on libclick, but I'd like to keep at least some of the tests that apply to these functions, so eg, looking at:
http://bazaar.launchpad.net/~mvo/unity-scope-click/lp1292645/revision/223

in that branch I see that we can keep getAvailableFrameworksTwoResults and getAvailableFrameworksNoResults if we can mock the result returned by click_framework_get_frameworks.

But gmock can only mock non-static methods, so the workaround is adding yet another class, like explained here: https://code.google.com/p/googlemock/wiki/FrequentlyAskedQuestions#My_code_calls_a_static/global_function.__Can_I_mock_it?

I started preparing a branch that show how to do this:
https://code.launchpad.net/~alecu/unity-scope-click/lp1292645

That branch is missing a way to create fake Framework instances, because their constructor is private; what should happen is that a new GObject type should be created that has the same "name" property as Framework. Or, perhaps simpler, its constructor should be made public in the vala library. I'm travelling tomorrow to the sprint, so I won't be able to continue working on this for a few days; feel free to take over it, or else I can work on my return.

In any case, I agree that this is a lot of work to test these functions that look so simple, so I'm open to discussing alternative options.

review: Needs Information

« Back to merge proposal