summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authora.srour <a.srour@samsung.com>2019-12-26 17:45:29 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-12-26 17:45:30 +0900
commit43bd6ab7ea86f4947ee7306c346e716329b93422 (patch)
tree8bda8106e205d4a97541559d0ad4e937870cdd6c /src/tests/evas
parenta239fc4a1a22ba05a7106248c0cb1655cc87d2c3 (diff)
Efl.Text.Cursor: Add tests for evas_suite
Summary: This patch add tests for almost all `Efl.Text.Cursor` exposed methods. Test Plan: Using `ninja test` Reviewers: ali.alzyod, segfaultxavi, woohyun Subscribers: #committers, cedric, #reviewers Tags: #efl Maniphest Tasks: T8454 Differential Revision: https://phab.enlightenment.org/D10950
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c270
1 files changed, 251 insertions, 19 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 33bbad6472..64dc47996b 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4490,6 +4490,8 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4490 efl_text_set(txt, buf); 4490 efl_text_set(txt, buf);
4491 ck_assert_int_eq(strcmp(efl_text_get(txt), buf), 0); 4491 ck_assert_int_eq(strcmp(efl_text_get(txt), buf), 0);
4492 4492
4493 pos = efl_text_cursor_position_get(cur_obj);
4494 ck_assert_int_eq(pos, 0);
4493 ck_assert(!efl_text_cursor_line_jump_by(cur_obj, -1)); 4495 ck_assert(!efl_text_cursor_line_jump_by(cur_obj, -1));
4494 pos = efl_text_cursor_position_get(cur_obj); 4496 pos = efl_text_cursor_position_get(cur_obj);
4495 ck_assert_int_eq(pos, 0); 4497 ck_assert_int_eq(pos, 0);
@@ -4497,6 +4499,21 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4497 pos = efl_text_cursor_position_get(cur_obj); 4499 pos = efl_text_cursor_position_get(cur_obj);
4498 ck_assert_int_eq(pos, 10); 4500 ck_assert_int_eq(pos, 10);
4499 4501
4502 efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
4503 efl_text_cursor_position_set(cur_obj, 0);
4504 ck_assert_int_eq(efl_text_cursor_line_number_get(cur_obj), 0);
4505 ck_assert(efl_text_cursor_line_jump_by(cur_obj, 2));
4506 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 24);
4507 ck_assert_int_eq(efl_text_cursor_line_number_get(cur_obj), 2);
4508 ck_assert(efl_text_cursor_line_jump_by(cur_obj, -2));
4509 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4510 ck_assert_int_eq(efl_text_cursor_line_number_get(cur_obj), 0);
4511
4512 ck_assert(efl_text_cursor_line_jump_by(cur_obj, 2));
4513 efl_text_cursor_line_number_set(cur_obj, 2);
4514 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 24);
4515 efl_text_cursor_line_number_set(cur_obj, 0);
4516 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4500 4517
4501 Eo * cursor1 = efl_add(EFL_TEXT_CURSOR_CLASS, txt); 4518 Eo * cursor1 = efl_add(EFL_TEXT_CURSOR_CLASS, txt);
4502 pos = efl_text_cursor_position_get(cursor1); 4519 pos = efl_text_cursor_position_get(cursor1);
@@ -4515,33 +4532,248 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4515 efl_text_cursor_text_insert(cursor1, "aa"); 4532 efl_text_cursor_text_insert(cursor1, "aa");
4516 ck_assert_int_eq(changed_emit, 3); 4533 ck_assert_int_eq(changed_emit, 3);
4517 4534
4518 Eo *cursor_temp = efl_add(EFL_TEXT_CURSOR_CLASS, txt); 4535 efl_text_set(txt, "");
4519 efl_text_cursor_copy(cursor1 ,cursor_temp); 4536 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
4520 ck_assert_ptr_eq( 4537 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
4521 efl_text_cursor_text_object_get(cursor1), 4538 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
4522 efl_text_cursor_text_object_get(cursor_temp)); 4539 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV));
4540 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_START));
4541 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
4542 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
4543 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END));
4544 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
4545 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4546 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
4547 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_PREV));
4548 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST));
4549 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LAST));
4550 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4551
4552 ck_assert_int_eq(changed_emit, 4);
4523 4553
4524 efl_text_set(txt, "occaecat \n mollit"); 4554 efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
4525 efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST); 4555 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
4526 efl_text_cursor_line_jump_by(cur_obj, 1); 4556 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1);
4527 efl_text_cursor_line_jump_by(cur_obj, -1); 4557 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
4558 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4559 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
4560 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1);
4561 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV));
4528 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); 4562 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4529 4563
4530 efl_text_set(txt, "Word"); 4564 efl_text_cursor_position_set(cur_obj, 0);
4531 efl_text_cursor_position_set(cur_obj, 1); 4565 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4532 changed_emit = 0; 4566 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4);
4533 efl_event_callback_add(cur_obj, EFL_TEXT_CURSOR_EVENT_CHANGED, _increment_int_changed, &changed_emit); 4567 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4568 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4);
4534 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START)); 4569 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
4535 ck_assert_int_eq(changed_emit, 1); 4570 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4536
4537 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START)); 4571 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
4538 ck_assert_int_eq(changed_emit, 1); 4572 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4539 4573
4540 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END)); 4574 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4541 ck_assert_int_eq(changed_emit, 2); 4575 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
4576 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5);
4577 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4578 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 10);
4579 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
4580 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4581 ck_assert_int_ne(efl_text_cursor_position_get(cur_obj), 10);
4582
4583 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END));
4584 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
4585 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END));
4586 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
4587 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
4588 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 12);
4589 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
4590 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 12);
4591 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
4592 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
4593 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4542 4594
4543 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END)); 4595#if defined(HAVE_FRIBIDI) && defined(HAVE_HARFBUZZ)
4544 ck_assert_int_eq(changed_emit, 2); 4596 efl_text_markup_set(txt, "الْبَرْمَجةُ<ps/>مَرْحبَاً");
4597 efl_text_cursor_cluster_coord_set(cur_obj, EINA_POSITION2D(0, 0));
4598 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
4599 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1);
4600 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
4601 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 3);
4602 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
4603 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5);
4604 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
4605 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4);
4606 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
4607 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5);
4608 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
4609 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 6);
4610 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
4611 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 7);
4612
4613 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
4614 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 13);
4615 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
4616 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 13);
4617 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
4618 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
4619 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
4620 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
4621 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LAST));
4622 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
4623 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_START));
4624 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 13);
4625 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
4626 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
4627 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST));
4628 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4629#endif
4630
4631 Eo *nCur = efl_add(EFL_TEXT_CURSOR_CLASS, txt), *nCur2 = efl_add(EFL_TEXT_CURSOR_CLASS, txt), *nCur3 = efl_add(EFL_TEXT_CURSOR_CLASS, txt);
4632 efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
4633 efl_text_cursor_position_set(cur_obj, 0);
4634 efl_text_cursor_copy(cur_obj, nCur);
4635 ck_assert_ptr_ne(nCur, NULL);
4636 efl_text_cursor_copy(cur_obj, nCur2);
4637 efl_text_cursor_copy(cur_obj, nCur3);
4638 ck_assert_ptr_ne(nCur2, NULL);
4639 ck_assert_ptr_ne(nCur3, NULL);
4640
4641 ck_assert(efl_text_cursor_equal(cur_obj, nCur));
4642 ck_assert(efl_text_cursor_equal(cur_obj, nCur2));
4643 ck_assert(efl_text_cursor_equal(cur_obj, nCur3));
4644 ck_assert(efl_text_cursor_equal(nCur2, nCur3));
4645
4646 ck_assert_int_eq(efl_text_cursor_compare(cur_obj, nCur3), 0);
4647 ck_assert_int_eq(efl_text_cursor_compare(nCur2, nCur3), 0);
4648 ck_assert_int_eq(efl_text_cursor_compare(cur_obj, nCur), 0);
4649
4650 ck_assert(efl_text_cursor_move(nCur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
4651 ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur), 0);
4652 ck_assert_int_gt(efl_text_cursor_compare(nCur, cur_obj), 0);
4653 efl_text_cursor_copy(nCur, nCur2);
4654 ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur2), 0);
4655 ck_assert_int_gt(efl_text_cursor_compare(nCur2, cur_obj), 0);
4656 ck_assert(!efl_text_cursor_equal(nCur2, nCur3));
4657
4658 efl_text_set(txt, "");
4659 efl_text_cursor_text_insert(cur_obj, "Hello World");
4660 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 11);
4661 efl_text_cursor_text_insert(cur_obj, "Hello World");
4662 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
4663 ck_assert_str_eq(efl_text_get(txt), "Hello WorldHello World");
4664
4665 efl_text_set(txt, "");
4666 efl_text_cursor_markup_insert(cur_obj, "Hello World<ps/>Hello World");
4667 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
4668
4669 efl_text_cursor_char_coord_set(cur_obj, EINA_POSITION2D(0, 0));
4670 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4671 efl_text_cursor_char_coord_set(cur_obj, EINA_POSITION2D(500, 500));
4672 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
4673 efl_text_cursor_cluster_coord_set(cur_obj, EINA_POSITION2D(0, 0));
4674 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4675 efl_text_cursor_cluster_coord_set(cur_obj, EINA_POSITION2D(500, 500));
4676 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
4677
4678 efl_text_cursor_position_set(nCur, 0);
4679 efl_text_cursor_position_set(cur_obj, 5);
4680
4681 ck_assert_str_eq(efl_text_cursor_range_text_get(cur_obj, nCur), "Hello");
4682 ck_assert_str_eq(efl_text_cursor_range_text_get(nCur, cur_obj), "Hello");
4683
4684 efl_text_cursor_position_set(nCur, 0);
4685 efl_text_cursor_position_set(cur_obj, 17);
4686
4687 Eina_Iterator *iter = efl_text_cursor_range_geometry_get(cur_obj, nCur);
4688 Eina_Rect *geoRect;
4689 int x = 0;
4690
4691 EINA_ITERATOR_FOREACH(iter, geoRect)
4692 {
4693 x ++;
4694 ck_assert_int_ne(geoRect->w, 0);
4695 ck_assert_int_ne(geoRect->h, 0);
4696 }
4697
4698 ck_assert_int_eq(x, 3);
4699
4700 iter = efl_text_cursor_range_precise_geometry_get(cur_obj, nCur);
4701 x = 0;
4702
4703 EINA_ITERATOR_FOREACH(iter, geoRect)
4704 {
4705 x ++;
4706 ck_assert_int_ne(geoRect->w, 0);
4707 ck_assert_int_ne(geoRect->h, 0);
4708 }
4709
4710 ck_assert_int_eq(x, 2);
4711
4712 ck_assert_str_eq(efl_text_cursor_range_markup_get(cur_obj, nCur), "Hello World<ps/>Hello");
4713 ck_assert_str_eq(efl_text_cursor_range_markup_get(nCur, cur_obj), "Hello World<ps/>Hello");
4714
4715 efl_text_cursor_position_set(nCur, 0);
4716 efl_text_cursor_position_set(cur_obj, 5);
4717
4718 efl_text_cursor_range_delete(nCur, cur_obj);
4719
4720 ck_assert_str_eq(efl_text_markup_get(txt), " World<ps/>Hello World");
4721 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4722 ck_assert_int_eq(efl_text_cursor_position_get(nCur), 0);
4723
4724 efl_text_markup_set(txt, "Hello World<ps/>Hello World");
4725 efl_text_cursor_position_set(cur_obj, 6);
4726 Eina_Unicode str[2] = {0};
4727 str[0] = efl_text_cursor_content_get(cur_obj);
4728 ck_assert_str_eq(eina_unicode_unicode_to_utf8(str, NULL), "W");
4729
4730 efl_text_cursor_char_delete(cur_obj);
4731
4732 str[0] = efl_text_cursor_content_get(cur_obj);
4733 ck_assert_str_eq(eina_unicode_unicode_to_utf8(str, NULL), "o");
4734
4735 Eo *cur_txt = efl_text_cursor_text_object_get(cur_obj);
4736 Eo *cur_txt2 = efl_text_cursor_text_object_get(nCur);
4737 ck_assert_ptr_eq(cur_txt, txt);
4738 ck_assert_ptr_eq(cur_txt2, txt);
4739
4740 efl_text_cursor_position_set(cur_obj, 1);
4741 Eina_Rect rect = efl_text_cursor_content_geometry_get(cur_obj);
4742 ck_assert_int_ne(rect.w, 0);
4743 ck_assert_int_ne(rect.h, 0);
4744 ck_assert_int_ne(rect.x, 0);
4745
4746 rect = efl_text_cursor_geometry_get(cur_obj, EFL_TEXT_CURSOR_TYPE_BEFORE);
4747 ck_assert_int_eq(rect.w, 0);
4748 ck_assert_int_ne(rect.h, 0);
4749 ck_assert_int_ne(rect.x, 0);
4750
4751 Eina_Rect rect2 = efl_text_cursor_geometry_get(cur_obj, EFL_TEXT_CURSOR_TYPE_UNDER);
4752 ck_assert_int_ne(rect2.w, 0);
4753 ck_assert_int_ne(rect2.h, 0);
4754 ck_assert_int_ne(rect2.x, 0);
4755
4756 ck_assert_int_ne(rect2.w, rect.w);
4757 ck_assert_int_eq(rect2.h, rect.h);
4758 ck_assert_int_eq(rect2.x, rect.x);
4759 ck_assert_int_eq(rect2.y, rect.y);
4760
4761 efl_text_markup_set(txt, "Hello World");
4762 efl_text_cursor_position_set(cur_obj, 11);
4763 ck_assert(!efl_text_cursor_lower_cursor_geometry_get(cur_obj, &rect2));
4764#ifdef HAVE_FRIBIDI
4765 efl_text_cursor_text_insert(cur_obj, "مرحباً");
4766 rect = efl_text_cursor_geometry_get(cur_obj, EFL_TEXT_CURSOR_TYPE_BEFORE);
4767 ck_assert(efl_text_cursor_lower_cursor_geometry_get(cur_obj, &rect2));
4768 ck_assert_int_eq(rect2.w, 0);
4769 ck_assert_int_ne(rect2.h, 0);
4770 ck_assert_int_ne(rect2.x, 0);
4771
4772 ck_assert_int_eq(rect2.w, rect.w);
4773 ck_assert_int_eq(rect2.h, rect.h);
4774 ck_assert_int_ne(rect2.x, rect.x);
4775 ck_assert_int_eq(rect2.y, rect.y);
4776#endif
4545 4777
4546 END_EFL_CANVAS_TEXTBLOCK_TEST(); 4778 END_EFL_CANVAS_TEXTBLOCK_TEST();
4547} 4779}