eolian: API and tests for beta events
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 8 May 2015 13:37:02 +0000 (14:37 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 8 May 2015 13:37:02 +0000 (14:37 +0100)
src/lib/eolian/Eolian.h
src/lib/eolian/database_event_api.c
src/tests/eolian/data/events.eo
src/tests/eolian/eolian_parsing.c

index 6223000..77b26b0 100644 (file)
@@ -1327,6 +1327,16 @@ EAPI Eina_Stringshare *eolian_event_description_get(const Eolian_Event *event);
 EAPI Eolian_Object_Scope eolian_event_scope_get(const Eolian_Event *event);
 
 /*
+ * @brief Get whether an event is beta.
+ *
+ * @param[in] event the event handle
+ * @return EINA_TRUE and EINA_FALSE respectively
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Bool eolian_event_is_beta(const Eolian_Event *event);
+
+/*
  * @brief Returns the C name of an event
  *
  * @param[in] event the event handle
index 0a6b22d..26a5167 100644 (file)
@@ -33,6 +33,13 @@ eolian_event_scope_get(const Eolian_Event *event)
    return event->scope;
 }
 
+EAPI Eina_Bool
+eolian_event_is_beta(const Eolian_Event *event)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(event, EINA_FALSE);
+   return event->is_beta;
+}
+
 EAPI Eina_Stringshare *
 eolian_event_c_name_get(const Eolian_Event *event)
 {
index 3057222..76a18db 100644 (file)
@@ -1,6 +1,6 @@
 class Events {
    events {
-      clicked; /*@ Comment for clicked */
+      clicked @beta; /*@ Comment for clicked */
       clicked,double: Evas_Event_Clicked_Double_Info; /* No comment */
    }
 }
index e9d35d2..99113ef 100644 (file)
@@ -119,6 +119,7 @@ START_TEST(eolian_events)
    fail_if(!(comment = eolian_event_description_get(ev)));
    fail_if(strcmp(name, "clicked"));
    fail_if(strcmp(comment, "Comment for clicked"));
+   fail_if(!eolian_event_is_beta(ev));
    /* Clicked,double */
    fail_if(!(eina_iterator_next(iter, (void**)&ev)));
    fail_if(!(name = eolian_event_name_get(ev)));
@@ -127,6 +128,7 @@ START_TEST(eolian_events)
    fail_if(strcmp(name, "clicked,double"));
    type_name = eolian_type_name_get(type);
    fail_if(strcmp(type_name, "Evas_Event_Clicked_Double_Info"));
+   fail_if(eolian_event_is_beta(ev));
    fail_if(eina_iterator_next(iter, &dummy));
    eina_iterator_free(iter);
    /* Check eolian_class_event_get_by_name */