* @}
*/
+#ifdef HAVE_TESTS
+/* return EINA_FALSE on error, used in unit_testing */
+EAPI Eina_Bool
+_evas_textblock_check_item_node_link(Evas_Object *obj)
+{
+ Evas_Object_Textblock *o;
+ Evas_Object_Textblock_Paragraph *par;
+ Evas_Object_Textblock_Line *ln;
+ Evas_Object_Textblock_Item *it;
+
+ o = (Evas_Object_Textblock *)(obj->object_data);
+ if (!o) return EINA_FALSE;
+
+ if (!o->formatted.valid) _relayout(obj);
+
+ EINA_INLIST_FOREACH(o->paragraphs, par)
+ {
+ EINA_INLIST_FOREACH(par->lines, ln)
+ {
+ EINA_INLIST_FOREACH(ln->items, it)
+ {
+ if (it->text_node != par->text_node)
+ return EINA_FALSE;
+ }
+ }
+ }
+ return EINA_TRUE;
+}
+#endif
#if 0
/* Good for debugging */
#include "evas_tests_helpers.h"
+/* Functions defined in evas_object_textblock.c */
+EAPI Eina_Bool
+_evas_textblock_check_item_node_link(Evas_Object *obj);
+/* end of functions defined in evas_object_textblock.c */
+
+
static const char *style_buf =
"DEFAULT='font=Sans font_size=10 color=#000 text_class=entry'"
"br='\n'"
evas_object_textblock_text_markup_set(tb, "|");
evas_object_textblock_size_formatted_get(tb, &w, &h);
fail_if((w != bw) || (h != bh));
+
+ /* Items have correct text node information */
+ evas_object_textblock_text_markup_set(tb, "");
+ fail_if(!_evas_textblock_check_item_node_link(tb));
+ evas_object_textblock_text_markup_set(tb, "<ps>");
+ fail_if(!_evas_textblock_check_item_node_link(tb));
+ evas_object_textblock_text_markup_set(tb, "a<ps>");
+ fail_if(!_evas_textblock_check_item_node_link(tb));
+ evas_object_textblock_text_markup_set(tb, "a<ps>a");
+ fail_if(!_evas_textblock_check_item_node_link(tb));
+ evas_object_textblock_text_markup_set(tb, "a<ps>a<ps>");
+ fail_if(!_evas_textblock_check_item_node_link(tb));
+ evas_object_textblock_text_markup_set(tb, "a<ps>a<ps>a");
+ fail_if(!_evas_textblock_check_item_node_link(tb));
+
END_TB_TEST();
}
END_TEST