summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-09 22:33:07 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-01-09 22:33:07 +0900
commit1a02745a88eb863cad307f0ba9fd386594ce4e82 (patch)
tree229ed0c86d342e7d65027311fc3dffbc7aa95621 /src/tests/evas
parent7b0a44dd3316d32e8150d9c800e00d923fc3a684 (diff)
efl.text.cursor: change to abstract class
Summary: 1- Change cursor to abstract class 2- Remove copy method from cursor 3- remove cursor_Add method from efl.canvas.textblock and efl.ui.textbox Reviewers: woohyun, segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: lauromoura, YOhoho, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8299, T8454 Differential Revision: https://phab.enlightenment.org/D11034
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index c23eb65caa..b51f149174 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4515,14 +4515,12 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4515 efl_text_cursor_line_number_set(cur_obj, 0); 4515 efl_text_cursor_line_number_set(cur_obj, 0);
4516 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); 4516 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4517 4517
4518 Eo * cursor1 = efl_add(EFL_TEXT_CURSOR_CLASS, txt); 4518 Eo * cursor_temp = efl_duplicate(cur_obj);
4519 pos = efl_text_cursor_position_get(cursor1); 4519 ck_assert_ptr_ne(cursor_temp, NULL);
4520 ck_assert_int_eq(pos, -1); 4520 efl_del(cursor_temp);
4521 efl_text_cursor_position_set(cursor1, 10); 4521 cursor_temp = NULL;
4522 pos = efl_text_cursor_position_get(cursor1);
4523 ck_assert_int_eq(pos, -1);
4524 4522
4525 efl_canvas_textblock_cursor_add(txt, cursor1); 4523 Eo * cursor1 = efl_canvas_textblock_cursor_create(txt);
4526 efl_text_cursor_position_set(cursor1, 1); 4524 efl_text_cursor_position_set(cursor1, 1);
4527 pos = efl_text_cursor_position_get(cursor1); 4525 pos = efl_text_cursor_position_get(cursor1);
4528 ck_assert_int_eq(pos, 1); 4526 ck_assert_int_eq(pos, 1);
@@ -4633,13 +4631,12 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4633 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); 4631 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4634#endif 4632#endif
4635 4633
4636 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); 4634 Eo *nCur = efl_canvas_textblock_cursor_create(txt);
4635 Eo *nCur2 = efl_canvas_textblock_cursor_create(txt);
4636 Eo *nCur3 = efl_canvas_textblock_cursor_create(txt);
4637 efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment"); 4637 efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
4638 efl_text_cursor_position_set(cur_obj, 0); 4638 efl_text_cursor_position_set(cur_obj, 0);
4639 efl_text_cursor_copy(cur_obj, nCur);
4640 ck_assert_ptr_ne(nCur, NULL); 4639 ck_assert_ptr_ne(nCur, NULL);
4641 efl_text_cursor_copy(cur_obj, nCur2);
4642 efl_text_cursor_copy(cur_obj, nCur3);
4643 ck_assert_ptr_ne(nCur2, NULL); 4640 ck_assert_ptr_ne(nCur2, NULL);
4644 ck_assert_ptr_ne(nCur3, NULL); 4641 ck_assert_ptr_ne(nCur3, NULL);
4645 4642
@@ -4655,7 +4652,7 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4655 ck_assert(efl_text_cursor_move(nCur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT)); 4652 ck_assert(efl_text_cursor_move(nCur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
4656 ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur), 0); 4653 ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur), 0);
4657 ck_assert_int_gt(efl_text_cursor_compare(nCur, cur_obj), 0); 4654 ck_assert_int_gt(efl_text_cursor_compare(nCur, cur_obj), 0);
4658 efl_text_cursor_copy(nCur, nCur2); 4655 efl_text_cursor_position_set(nCur2, efl_text_cursor_position_get(nCur));
4659 ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur2), 0); 4656 ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur2), 0);
4660 ck_assert_int_gt(efl_text_cursor_compare(nCur2, cur_obj), 0); 4657 ck_assert_int_gt(efl_text_cursor_compare(nCur2, cur_obj), 0);
4661 ck_assert(!efl_text_cursor_equal(nCur2, nCur3)); 4658 ck_assert(!efl_text_cursor_equal(nCur2, nCur3));