summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2020-04-20 14:36:14 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2020-04-20 14:36:14 +0200
commitbbc006a3e72d323e73bb77ee546fd8f0f6d741a6 (patch)
treecbdab88aae5c066f85f5ecf7a8b0391433b0d4e1
parente565e989eee5846bc121ddff80ca75c3642d3427 (diff)
eolian: fix C type serialization of error()
-rw-r--r--src/lib/eolian/database_type.c2
-rw-r--r--src/tests/eolian/eolian_parsing.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index 53d531cc54..0df427bf62 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -121,6 +121,8 @@ database_type_to_str(const Eolian_Type *tp,
121 else 121 else
122 eina_strbuf_append(buf, tp->base.c_name); 122 eina_strbuf_append(buf, tp->base.c_name);
123 } 123 }
124 else if (tp->type == EOLIAN_TYPE_ERROR)
125 eina_strbuf_append(buf, "Eina_Error");
124 else if (tp->type == EOLIAN_TYPE_VOID) 126 else if (tp->type == EOLIAN_TYPE_VOID)
125 eina_strbuf_append(buf, "void"); 127 eina_strbuf_append(buf, "void");
126 else if (tp->type == EOLIAN_TYPE_UNDEFINED) 128 else if (tp->type == EOLIAN_TYPE_UNDEFINED)
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 60e24bda41..ae213b5a28 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -805,6 +805,7 @@ EFL_START_TEST(eolian_error)
805 const Eolian_Function *f1, *f2; 805 const Eolian_Function *f1, *f2;
806 const Eolian_Type *rtp1, *rtp2; 806 const Eolian_Type *rtp1, *rtp2;
807 const Eolian_Error *err1, *err2; 807 const Eolian_Error *err1, *err2;
808 Eina_Stringshare *str;
808 809
809 Eolian_State *eos = eolian_state_new(); 810 Eolian_State *eos = eolian_state_new();
810 811
@@ -822,6 +823,9 @@ EFL_START_TEST(eolian_error)
822 fail_if(eolian_type_type_get(rtp1) != EOLIAN_TYPE_ERROR); 823 fail_if(eolian_type_type_get(rtp1) != EOLIAN_TYPE_ERROR);
823 fail_if(eolian_type_next_type_get(rtp1) != NULL); 824 fail_if(eolian_type_next_type_get(rtp1) != NULL);
824 fail_if(strcmp(eolian_type_name_get(rtp1), "Foo")); 825 fail_if(strcmp(eolian_type_name_get(rtp1), "Foo"));
826 fail_if(!(str = eolian_type_c_type_get(rtp1)));
827 fail_if(strcmp(str, "Eina_Error"));
828 eina_stringshare_del(str);
825 fail_if(!(err1 = eolian_type_error_get(rtp1))); 829 fail_if(!(err1 = eolian_type_error_get(rtp1)));
826 fail_if(strcmp(eolian_error_message_get(err1), "something bad happened")); 830 fail_if(strcmp(eolian_error_message_get(err1), "something bad happened"));
827 831