[webkit-efl] Why don't we use Eina_Bool in unit test when testing public APIs ?

Dumez, Christophe christophe.dumez at intel.com
Mon Sep 24 05:56:15 PDT 2012


Hi,

When we call a public Ewk API from WebKit implementation, we use regular
booleans (not EINA_TRUE/EINA_FALSE). Why would we do it differently in unit
tests?
unit tests are written in C++ and are private code.

The point of using regular boolean in the first place was to facilitate
review by using same types as in the rest of WebKit. I think this argument
is still valid for unit tests.

Kr,
Chris.

On Mon, Sep 24, 2012 at 3:37 PM, Gyuyoung Kim <gyuyoung at gmail.com> wrote:

> Hi EFL folks,
>
> I would like to discuss EINA_TRUE / FALSE usage in unit test. As you folks
> know, we have used *standard boolean* type except for public API and efl
> callback function.
> However, in my humble opinion, it would be good to use Eina_Bool in unit
> test when we test public APIs. Because EFL application will use Eina_Bool
> instead of standard boolean.
>
> Almost existing unit test cases are using Eina_Bool, for example, in
> test_ewk2_view.cpp.
>
> TEST_F(EWK2UnitTestBase, ewk_view_mouse_events_enabled)
> {
>     ASSERT_TRUE(ewk_view_mouse_events_enabled_set(webView(), EINA_TRUE));
>     ASSERT_TRUE(ewk_view_mouse_events_enabled_get(webView()));
>
>     ASSERT_TRUE(ewk_view_mouse_events_enabled_set(webView(), 2));
>     ASSERT_TRUE(ewk_view_mouse_events_enabled_get(webView()));
>
>     ASSERT_TRUE(ewk_view_mouse_events_enabled_set(webView(), EINA_FALSE));
>     ASSERT_FALSE(ewk_view_mouse_events_enabled_get(webView()));
> }
>
> I'd like to listen EFL folks opinion. If there is no objection, I will add
> this to EFL coding style guidance.
>
> Cheers,
>
> --
> Gyuyoung Kim
> SW Engineer, WebKit EFL
> Email : gyuyoung.kim at webkit.org
> Phone : +82 10 9530 0209
>
>
> _______________________________________________
> webkit-efl mailing list
> webkit-efl at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-efl
>
>


-- 
Christophe Dumez
Linux Software Engineer, PhD
Intel Finland Oy - Open Source Technology Center
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-efl/attachments/20120924/f375ea38/attachment.html>


More information about the webkit-efl mailing list