summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-12-10 17:39:59 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-12-10 17:39:59 +0900
commit621d2cdecf8f53526f1e8ca427bf815086768a28 (patch)
tree51a3564d46e311b7c688fdb16a58abd479acf290 /src/tests/evas
parentf793939315b37a6a8332af0ec870a0af1b6ad434 (diff)
Efl.Canvas.Text rename into Efl.Canvas.Textblock
Summary: Efl.Canvas.Text renamed into **Efl.Canvas.Textblock** Efl.Canvas.Text_Factory renamed into **Efl.Canvas.Textblock_Factory** Reviewers: woohyun, segfaultxavi, zmike, bu5hm4n, YOhoho Reviewed By: segfaultxavi Subscribers: cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10808
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 4c33a8fd43..786be4a3f0 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -49,7 +49,7 @@ static const char *style_buf =
49 fail_if(strcmp(style_buf, evas_textblock_style_get(st))); \ 49 fail_if(strcmp(style_buf, evas_textblock_style_get(st))); \
50 evas_object_textblock_style_set(tb, st); \ 50 evas_object_textblock_style_set(tb, st); \
51 cur = evas_object_textblock_cursor_new(tb); \ 51 cur = evas_object_textblock_cursor_new(tb); \
52 cur_obj =efl_canvas_text_cursor_create(tb);\ 52 cur_obj =efl_canvas_textblock_cursor_create(tb);\
53 (void) cur_obj;\ 53 (void) cur_obj;\
54 (void) cur;\ 54 (void) cur;\
55do \ 55do \
@@ -4319,8 +4319,8 @@ EFL_START_TEST(evas_textblock_annotation)
4319 START_TB_TEST(); 4319 START_TB_TEST();
4320 Efl_Text_Cursor *start, *end; 4320 Efl_Text_Cursor *start, *end;
4321 4321
4322 start = efl_canvas_text_cursor_create(tb); 4322 start = efl_canvas_textblock_cursor_create(tb);
4323 end = efl_canvas_text_cursor_create(tb); 4323 end = efl_canvas_textblock_cursor_create(tb);
4324 4324
4325 const char *buf = 4325 const char *buf =
4326 "This text will check annotation." 4326 "This text will check annotation."
@@ -4353,19 +4353,19 @@ EFL_END_TEST;
4353static const char *efl_style_buf = 4353static const char *efl_style_buf =
4354 "" TEST_FONT " font_size=10 color=#000 text_class=entry"; 4354 "" TEST_FONT " font_size=10 color=#000 text_class=entry";
4355 4355
4356#define START_EFL_CANVAS_TEXT_TEST() \ 4356#define START_EFL_CANVAS_TEXTBLOCK_TEST() \
4357 Evas *evas; \ 4357 Evas *evas; \
4358 Eo *txt; \ 4358 Eo *txt; \
4359 Efl_Text_Cursor_Handle *cur; \ 4359 Efl_Text_Cursor_Handle *cur; \
4360 Efl_Text_Cursor *cur_obj; \ 4360 Efl_Text_Cursor *cur_obj; \
4361 evas = EVAS_TEST_INIT_EVAS(); \ 4361 evas = EVAS_TEST_INIT_EVAS(); \
4362 evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \ 4362 evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \
4363 txt = efl_add(EFL_CANVAS_TEXT_CLASS, evas); \ 4363 txt = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, evas); \
4364 fail_if(!txt); \ 4364 fail_if(!txt); \
4365 efl_canvas_text_newline_as_paragraph_separator_set(txt, EINA_FALSE); \ 4365 efl_canvas_textblock_newline_as_paragraph_separator_set(txt, EINA_FALSE); \
4366 efl_canvas_text_style_apply(txt, efl_style_buf); \ 4366 efl_canvas_textblock_style_apply(txt, efl_style_buf); \
4367 fail_if(!efl_canvas_text_all_styles_get(txt)); \ 4367 fail_if(!efl_canvas_textblock_all_styles_get(txt)); \
4368 cur_obj = efl_canvas_text_cursor_create(txt);\ 4368 cur_obj = efl_canvas_textblock_cursor_create(txt);\
4369 cur = evas_object_textblock_cursor_new(txt); \ 4369 cur = evas_object_textblock_cursor_new(txt); \
4370 fail_if(!cur); \ 4370 fail_if(!cur); \
4371do \ 4371do \
@@ -4373,7 +4373,7 @@ do \
4373} \ 4373} \
4374while (0) 4374while (0)
4375 4375
4376#define END_EFL_CANVAS_TEXT_TEST() \ 4376#define END_EFL_CANVAS_TEXTBLOCK_TEST() \
4377do \ 4377do \
4378{ \ 4378{ \
4379 efl_del(cur_obj); \ 4379 efl_del(cur_obj); \
@@ -4383,11 +4383,11 @@ do \
4383} \ 4383} \
4384while (0) 4384while (0)
4385 4385
4386EFL_START_TEST(efl_canvas_text_simple) 4386EFL_START_TEST(efl_canvas_textblock_simple)
4387{ 4387{
4388 START_EFL_CANVAS_TEXT_TEST(); 4388 START_EFL_CANVAS_TEXTBLOCK_TEST();
4389 4389
4390 /* It is simple test for Efl_Canvas_Text. 4390 /* It is simple test for Efl_Canvas_Textblock.
4391 * The main object is "txt". */ 4391 * The main object is "txt". */
4392 const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t."; 4392 const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t.";
4393 efl_text_set(txt, buf); 4393 efl_text_set(txt, buf);
@@ -4403,7 +4403,7 @@ EFL_START_TEST(efl_canvas_text_simple)
4403 password = efl_text_password_get(txt); 4403 password = efl_text_password_get(txt);
4404 fail_if(password); 4404 fail_if(password);
4405 4405
4406 END_EFL_CANVAS_TEXT_TEST(); 4406 END_EFL_CANVAS_TEXTBLOCK_TEST();
4407} 4407}
4408EFL_END_TEST 4408EFL_END_TEST
4409 4409
@@ -4421,7 +4421,7 @@ EFL_START_TEST(efl_text)
4421 * Russian 't' in the beginnning to create additional item.*/ 4421 * Russian 't' in the beginnning to create additional item.*/
4422 /*01234 5 6789012345678 19 01234 */ 4422 /*01234 5 6789012345678 19 01234 */
4423 efl_text_set(tb, "тest \u202bנסיוןabcנסיון\u202c bang"); 4423 efl_text_set(tb, "тest \u202bנסיוןabcנסיון\u202c bang");
4424 size = efl_canvas_text_size_native_get(tb); 4424 size = efl_canvas_textblock_size_native_get(tb);
4425 nw = size.w; 4425 nw = size.w;
4426 nh = size.h; 4426 nh = size.h;
4427 4427
@@ -4445,9 +4445,9 @@ EFL_START_TEST(efl_text)
4445} 4445}
4446EFL_END_TEST 4446EFL_END_TEST
4447 4447
4448EFL_START_TEST(efl_canvas_text_cursor) 4448EFL_START_TEST(efl_canvas_textblock_cursor)
4449{ 4449{
4450 START_EFL_CANVAS_TEXT_TEST(); 4450 START_EFL_CANVAS_TEXTBLOCK_TEST();
4451 int pos; 4451 int pos;
4452 4452
4453 const char *buf = "abcdefghij"; 4453 const char *buf = "abcdefghij";
@@ -4469,24 +4469,24 @@ EFL_START_TEST(efl_canvas_text_cursor)
4469 pos = efl_text_cursor_position_get(cursor1); 4469 pos = efl_text_cursor_position_get(cursor1);
4470 ck_assert_int_eq(pos, -1); 4470 ck_assert_int_eq(pos, -1);
4471 4471
4472 efl_canvas_text_cursor_add(txt, cursor1); 4472 efl_canvas_textblock_cursor_add(txt, cursor1);
4473 efl_text_cursor_position_set(cursor1, 1); 4473 efl_text_cursor_position_set(cursor1, 1);
4474 pos = efl_text_cursor_position_get(cursor1); 4474 pos = efl_text_cursor_position_get(cursor1);
4475 ck_assert_int_eq(pos, 1); 4475 ck_assert_int_eq(pos, 1);
4476 4476
4477 END_EFL_CANVAS_TEXT_TEST(); 4477 END_EFL_CANVAS_TEXTBLOCK_TEST();
4478} 4478}
4479EFL_END_TEST 4479EFL_END_TEST
4480 4480
4481 4481
4482EFL_START_TEST(efl_canvas_text_markup) 4482EFL_START_TEST(efl_canvas_textblock_markup)
4483{ 4483{
4484 START_EFL_CANVAS_TEXT_TEST(); 4484 START_EFL_CANVAS_TEXTBLOCK_TEST();
4485 Efl_Text_Cursor *start, *end; 4485 Efl_Text_Cursor *start, *end;
4486 char *res; 4486 char *res;
4487 4487
4488 start = efl_canvas_text_cursor_create(txt); 4488 start = efl_canvas_textblock_cursor_create(txt);
4489 end = efl_canvas_text_cursor_create(txt); 4489 end = efl_canvas_textblock_cursor_create(txt);
4490 4490
4491 efl_text_set(txt, "\n\n\n"); 4491 efl_text_set(txt, "\n\n\n");
4492 4492
@@ -4503,13 +4503,13 @@ EFL_START_TEST(efl_canvas_text_markup)
4503 ck_assert_str_eq(res, "bc<br>"); 4503 ck_assert_str_eq(res, "bc<br>");
4504 free(res); 4504 free(res);
4505 4505
4506 END_EFL_CANVAS_TEXT_TEST(); 4506 END_EFL_CANVAS_TEXTBLOCK_TEST();
4507} 4507}
4508EFL_END_TEST 4508EFL_END_TEST
4509 4509
4510EFL_START_TEST(efl_canvas_text_markup_invalid_escape) 4510EFL_START_TEST(efl_canvas_textblock_markup_invalid_escape)
4511{ 4511{
4512 START_EFL_CANVAS_TEXT_TEST(); 4512 START_EFL_CANVAS_TEXTBLOCK_TEST();
4513 4513
4514 char * text1 = "Hello"; 4514 char * text1 = "Hello";
4515 char * text2 = "Hello&123"; 4515 char * text2 = "Hello&123";
@@ -4517,22 +4517,22 @@ EFL_START_TEST(efl_canvas_text_markup_invalid_escape)
4517 Eina_Size2D fw1, fw2, fw3; 4517 Eina_Size2D fw1, fw2, fw3;
4518 4518
4519 efl_text_markup_set(txt,text1); 4519 efl_text_markup_set(txt,text1);
4520 fw1 = efl_canvas_text_size_native_get(txt); 4520 fw1 = efl_canvas_textblock_size_native_get(txt);
4521 efl_text_markup_set(txt,text2); 4521 efl_text_markup_set(txt,text2);
4522 fw2 = efl_canvas_text_size_native_get(txt); 4522 fw2 = efl_canvas_textblock_size_native_get(txt);
4523 fail_if(fw2.w <= fw1.w); 4523 fail_if(fw2.w <= fw1.w);
4524 efl_text_markup_set(txt,text3); 4524 efl_text_markup_set(txt,text3);
4525 fw3 = efl_canvas_text_size_native_get(txt); 4525 fw3 = efl_canvas_textblock_size_native_get(txt);
4526 fail_if(fw3.w <= fw2.w); 4526 fail_if(fw3.w <= fw2.w);
4527 4527
4528 END_EFL_CANVAS_TEXT_TEST(); 4528 END_EFL_CANVAS_TEXTBLOCK_TEST();
4529} 4529}
4530EFL_END_TEST 4530EFL_END_TEST
4531 4531
4532 4532
4533EFL_START_TEST(efl_text_font) 4533EFL_START_TEST(efl_text_font)
4534{ 4534{
4535 START_EFL_CANVAS_TEXT_TEST(); 4535 START_EFL_CANVAS_TEXTBLOCK_TEST();
4536 4536
4537 efl_text_set(txt, "\n\n\n"); 4537 efl_text_set(txt, "\n\n\n");
4538 4538
@@ -4562,13 +4562,13 @@ EFL_START_TEST(efl_text_font)
4562 fail_if(30 != font_size); 4562 fail_if(30 != font_size);
4563 fail_if(strcmp(font,"arial")); 4563 fail_if(strcmp(font,"arial"));
4564 4564
4565 END_EFL_CANVAS_TEXT_TEST(); 4565 END_EFL_CANVAS_TEXTBLOCK_TEST();
4566} 4566}
4567EFL_END_TEST 4567EFL_END_TEST
4568 4568
4569EFL_START_TEST(efl_canvas_text_style) 4569EFL_START_TEST(efl_canvas_textblock_style)
4570{ 4570{
4571 START_EFL_CANVAS_TEXT_TEST(); 4571 START_EFL_CANVAS_TEXTBLOCK_TEST();
4572 unsigned char r, g, b, a; 4572 unsigned char r, g, b, a;
4573 const char *style; 4573 const char *style;
4574 4574
@@ -4578,9 +4578,9 @@ EFL_START_TEST(efl_canvas_text_style)
4578 efl_text_font_slant_set(txt, EFL_TEXT_FONT_SLANT_OBLIQUE); 4578 efl_text_font_slant_set(txt, EFL_TEXT_FONT_SLANT_OBLIQUE);
4579 efl_text_tabstops_set(txt, 20); 4579 efl_text_tabstops_set(txt, 20);
4580 4580
4581 efl_canvas_text_style_apply(txt, "color=#90E135"); 4581 efl_canvas_textblock_style_apply(txt, "color=#90E135");
4582 4582
4583 style = efl_canvas_text_all_styles_get(txt); 4583 style = efl_canvas_textblock_all_styles_get(txt);
4584 4584
4585 // from efl_style_buf 4585 // from efl_style_buf
4586 fail_if(!strstr(style, "font=DejaVuSans,UnDotum,malayalam")); 4586 fail_if(!strstr(style, "font=DejaVuSans,UnDotum,malayalam"));
@@ -4593,41 +4593,41 @@ EFL_START_TEST(efl_canvas_text_style)
4593 fail_if(!strstr(style, "color=rgba(144,225,53,255)")); 4593 fail_if(!strstr(style, "color=rgba(144,225,53,255)"));
4594 fail_if(!strstr(style, "password=off")); 4594 fail_if(!strstr(style, "password=off"));
4595 efl_text_password_set(txt, EINA_TRUE); 4595 efl_text_password_set(txt, EINA_TRUE);
4596 style = efl_canvas_text_all_styles_get(txt); 4596 style = efl_canvas_textblock_all_styles_get(txt);
4597 fail_if(!strstr(style, "password=on")); 4597 fail_if(!strstr(style, "password=on"));
4598 4598
4599 efl_canvas_text_style_apply(txt, "font_width=ultracondensed"); 4599 efl_canvas_textblock_style_apply(txt, "font_width=ultracondensed");
4600 ck_assert_int_eq(efl_text_font_width_get(txt), EFL_TEXT_FONT_WIDTH_ULTRACONDENSED); 4600 ck_assert_int_eq(efl_text_font_width_get(txt), EFL_TEXT_FONT_WIDTH_ULTRACONDENSED);
4601 4601
4602 efl_canvas_text_style_apply(txt, "wrap=none"); 4602 efl_canvas_textblock_style_apply(txt, "wrap=none");
4603 ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_NONE); 4603 ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_NONE);
4604 4604
4605 efl_canvas_text_style_apply(txt, "backing=on"); 4605 efl_canvas_textblock_style_apply(txt, "backing=on");
4606 ck_assert_int_eq(efl_text_backing_type_get(txt), EFL_TEXT_STYLE_BACKING_TYPE_ENABLED); 4606 ck_assert_int_eq(efl_text_backing_type_get(txt), EFL_TEXT_STYLE_BACKING_TYPE_ENABLED);
4607 4607
4608 efl_canvas_text_style_apply(txt, "style=far_soft_shadow"); 4608 efl_canvas_textblock_style_apply(txt, "style=far_soft_shadow");
4609 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW); 4609 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW);
4610 4610
4611 efl_canvas_text_style_apply(txt, "style=glow,top_right"); 4611 efl_canvas_textblock_style_apply(txt, "style=glow,top_right");
4612 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_GLOW); 4612 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_GLOW);
4613 ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT); 4613 ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT);
4614 4614
4615 efl_canvas_text_style_apply(txt, "style=far_shadow,top"); 4615 efl_canvas_textblock_style_apply(txt, "style=far_shadow,top");
4616 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SHADOW); 4616 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SHADOW);
4617 ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_TOP); 4617 ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_TOP);
4618 4618
4619 efl_canvas_text_style_apply(txt, "style=soft_outline,top,bottom"); 4619 efl_canvas_textblock_style_apply(txt, "style=soft_outline,top,bottom");
4620 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_SOFT_OUTLINE); 4620 ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_SOFT_OUTLINE);
4621 ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM); 4621 ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM);
4622 4622
4623 efl_canvas_text_style_apply(txt, "color=#EF596C"); 4623 efl_canvas_textblock_style_apply(txt, "color=#EF596C");
4624 efl_text_normal_color_get(txt, &r, &g, &b, &a); 4624 efl_text_normal_color_get(txt, &r, &g, &b, &a);
4625 ck_assert_int_eq(r, 0xEF); 4625 ck_assert_int_eq(r, 0xEF);
4626 ck_assert_int_eq(g, 0x59); 4626 ck_assert_int_eq(g, 0x59);
4627 ck_assert_int_eq(b, 0x6C); 4627 ck_assert_int_eq(b, 0x6C);
4628 ck_assert_int_eq(a, 0xFF); 4628 ck_assert_int_eq(a, 0xFF);
4629 4629
4630 END_EFL_CANVAS_TEXT_TEST(); 4630 END_EFL_CANVAS_TEXTBLOCK_TEST();
4631} 4631}
4632EFL_END_TEST 4632EFL_END_TEST
4633 4633
@@ -4659,12 +4659,12 @@ void evas_test_textblock(TCase *tc)
4659#endif 4659#endif
4660 tcase_add_test(tc, evas_textblock_text_iface); 4660 tcase_add_test(tc, evas_textblock_text_iface);
4661 tcase_add_test(tc, evas_textblock_annotation); 4661 tcase_add_test(tc, evas_textblock_annotation);
4662 tcase_add_test(tc, efl_canvas_text_simple); 4662 tcase_add_test(tc, efl_canvas_textblock_simple);
4663 tcase_add_test(tc, efl_text); 4663 tcase_add_test(tc, efl_text);
4664 tcase_add_test(tc, efl_canvas_text_cursor); 4664 tcase_add_test(tc, efl_canvas_textblock_cursor);
4665 tcase_add_test(tc, efl_canvas_text_markup); 4665 tcase_add_test(tc, efl_canvas_textblock_markup);
4666 tcase_add_test(tc, efl_canvas_text_markup_invalid_escape); 4666 tcase_add_test(tc, efl_canvas_textblock_markup_invalid_escape);
4667 tcase_add_test(tc, efl_text_font); 4667 tcase_add_test(tc, efl_text_font);
4668 tcase_add_test(tc, efl_canvas_text_style); 4668 tcase_add_test(tc, efl_canvas_textblock_style);
4669} 4669}
4670 4670