From d384012307881898a2df49f68fa6b46a4cd9972d Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 2 Jun 2016 17:19:08 -0700 Subject: [PATCH] elementary: merging in elm_code widget. Theme is not there as it should be manually merged into the elementary default theme. --- legacy/elm_code/src/tests/elm_code_suite.c | 130 ------------------ legacy/elm_code/src/tests/elm_code_suite.h | 31 ----- src/Makefile_Elementary.am | 46 ++++++- src/lib/elementary/Elementary.h.in | 1 + .../src/lib => src/lib/elementary}/elm_code.c | 4 +- .../lib/elementary/elm_code.h | 38 +---- .../lib/elementary}/elm_code_common.h | 0 .../lib/elementary}/elm_code_diff_widget.c | 6 +- .../lib/elementary}/elm_code_diff_widget.h | 0 .../lib/elementary}/elm_code_file.c | 7 +- .../lib/elementary}/elm_code_file.h | 0 .../lib/elementary}/elm_code_line.c | 6 +- .../lib/elementary}/elm_code_line.h | 0 .../lib/elementary}/elm_code_parse.c | 6 +- .../lib/elementary}/elm_code_parse.h | 0 .../lib/elementary}/elm_code_private.h | 0 .../lib/elementary}/elm_code_text.c | 6 +- .../lib/elementary}/elm_code_text.h | 0 .../lib/elementary}/elm_code_widget.c | 9 +- .../lib/elementary}/elm_code_widget.eo | 1 + .../lib/elementary}/elm_code_widget_legacy.h | 2 +- .../lib/elementary}/elm_code_widget_private.h | 0 .../elementary}/elm_code_widget_selection.c | 6 +- .../elementary}/elm_code_widget_selection.h | 0 .../lib/elementary}/elm_code_widget_text.c | 6 +- .../lib/elementary}/elm_code_widget_undo.c | 6 +- .../elementary}/elm_code_file_test_load.c | 36 +++-- .../elementary}/elm_code_file_test_memory.c | 12 +- .../tests/elementary}/elm_code_test_basic.c | 12 +- .../tests/elementary}/elm_code_test_line.c | 14 +- .../tests/elementary}/elm_code_test_parse.c | 16 ++- .../tests/elementary}/elm_code_test_text.c | 23 +++- .../tests/elementary}/elm_code_test_widget.c | 9 +- .../elm_code_test_widget_selection.c | 14 +- .../elementary}/elm_code_test_widget_text.c | 9 +- .../elementary}/elm_code_test_widget_undo.c | 7 +- src/tests/elementary/elm_suite.c | 9 ++ src/tests/elementary/elm_suite.h | 11 ++ src/tests/elementary/elm_test_helper.h | 13 ++ .../tests/elementary}/testdiff.diff | 0 .../tests/elementary}/testfile-windows.txt | 0 .../tests/elementary}/testfile-withblanks.txt | 0 .../tests/elementary}/testfile.txt | 0 43 files changed, 225 insertions(+), 271 deletions(-) delete mode 100644 legacy/elm_code/src/tests/elm_code_suite.c delete mode 100644 legacy/elm_code/src/tests/elm_code_suite.h rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code.c (97%) rename legacy/elm_code/src/lib/Elm_Code.h => src/lib/elementary/elm_code.h (77%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_common.h (100%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_diff_widget.c (98%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_diff_widget.h (100%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_file.c (99%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_file.h (100%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_line.c (98%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_line.h (100%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_parse.c (98%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_parse.h (100%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_private.h (100%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_text.c (98%) rename {legacy/elm_code/src/lib => src/lib/elementary}/elm_code_text.h (100%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget.c (99%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget.eo (99%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget_legacy.h (86%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget_private.h (100%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget_selection.c (99%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget_selection.h (100%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget_text.c (98%) rename {legacy/elm_code/src/lib/widget => src/lib/elementary}/elm_code_widget_undo.c (95%) rename {legacy/elm_code/src/tests => src/tests/elementary}/elm_code_file_test_load.c (80%) rename {legacy/elm_code/src/tests => src/tests/elementary}/elm_code_file_test_memory.c (82%) rename {legacy/elm_code/src/tests => src/tests/elementary}/elm_code_test_basic.c (59%) rename {legacy/elm_code/src/tests => src/tests/elementary}/elm_code_test_line.c (88%) rename {legacy/elm_code/src/tests => src/tests/elementary}/elm_code_test_parse.c (88%) rename {legacy/elm_code/src/tests => src/tests/elementary}/elm_code_test_text.c (91%) rename {legacy/elm_code/src/tests/widget => src/tests/elementary}/elm_code_test_widget.c (93%) rename {legacy/elm_code/src/tests/widget => src/tests/elementary}/elm_code_test_widget_selection.c (98%) rename {legacy/elm_code/src/tests/widget => src/tests/elementary}/elm_code_test_widget_text.c (92%) rename {legacy/elm_code/src/tests/widget => src/tests/elementary}/elm_code_test_widget_undo.c (97%) rename {legacy/elm_code/src/tests => src/tests/elementary}/testdiff.diff (100%) rename {legacy/elm_code/src/tests => src/tests/elementary}/testfile-windows.txt (100%) rename {legacy/elm_code/src/tests => src/tests/elementary}/testfile-withblanks.txt (100%) rename {legacy/elm_code/src/tests => src/tests/elementary}/testfile.txt (100%) diff --git a/legacy/elm_code/src/tests/elm_code_suite.c b/legacy/elm_code/src/tests/elm_code_suite.c deleted file mode 100644 index 31ea7d9f0e..0000000000 --- a/legacy/elm_code/src/tests/elm_code_suite.c +++ /dev/null @@ -1,130 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include - -#include "Elm_Code.h" -#include "elm_code_suite.h" - -#define COPYRIGHT "Copyright © 2014 Andy Williams and various contributors (see AUTHORS)." - -static const struct { - const char *name; - void (*build)(TCase *tc); -} tests[] = { - { "file_load", elm_code_file_test_load }, - { "file_memory", elm_code_file_test_memory }, - { "parse", elm_code_test_parse }, - { "text", elm_code_test_text }, - { "basic", elm_code_test_basic }, - { "widget", elm_code_test_widget }, - { "widget_text", elm_code_test_widget_text }, - { "widget_selection", elm_code_test_widget_selection }, - { "widget_undo", elm_code_test_widget_undo }, -}; - -START_TEST(elm_code_initialization) -{ - fail_if(elm_code_init() != 1); - -// TODO add other init checks here - - fail_if(elm_code_shutdown() != 0); -} -END_TEST - -void -edi_test_basic(TCase *tc) -{ - tcase_add_test(tc, elm_code_initialization); -} - -static const Ecore_Getopt optdesc = { - "elm_code", - "%prog [options]", - PACKAGE_VERSION, - COPYRIGHT, - "BSD with advertisement clause", - "Elm Code", - 0, - { - ECORE_GETOPT_STORE_TRUE('l', "list", "list available tests"), - ECORE_GETOPT_STORE_STR('t', "test", "test to run"), - ECORE_GETOPT_LICENSE('L', "license"), - ECORE_GETOPT_COPYRIGHT('C', "copyright"), - ECORE_GETOPT_VERSION('V', "version"), - ECORE_GETOPT_HELP('h', "help"), - ECORE_GETOPT_SENTINEL - } -}; - -int -main(int argc EINA_UNUSED, char **argv EINA_UNUSED) -{ - Suite *s; - SRunner *sr; - TCase *tc = NULL; - char *test = NULL; - unsigned int i; - int failed_count = -1; - int args; - Eina_Bool quit_option = EINA_FALSE; - Eina_Bool list_option = EINA_FALSE; - - Ecore_Getopt_Value values[] = { - ECORE_GETOPT_VALUE_BOOL(list_option), - ECORE_GETOPT_VALUE_STR(test), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_NONE - }; - - eina_init(); - - args = ecore_getopt_parse(&optdesc, values, argc, argv); - if (args < 0) - { - EINA_LOG_CRIT("Could not parse arguments."); - goto end; - } - else if (quit_option) - { - goto end; - } - else if (list_option) - { - fprintf(stdout, "Available tests :\n"); - for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) - fprintf(stdout, "\t%s\n", tests[i].name); - goto end; - } - - s = suite_create("Elm_Code"); - - for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) - { - if (test && strcmp(tests[i].name, test)) - continue ; - - tc = tcase_create(tests[i].name); - tcase_set_timeout(tc, 0); - - tests[i].build(tc); - suite_add_tcase(s, tc); - } - - sr = srunner_create(s); - srunner_set_xml(sr, PACKAGE_BUILD_DIR "/check-results.xml"); - - srunner_run_all(sr, CK_ENV); - failed_count = srunner_ntests_failed(sr); - srunner_free(sr); - - end: - eina_shutdown(); - - return (failed_count == 0) ? 0 : 255; -} diff --git a/legacy/elm_code/src/tests/elm_code_suite.h b/legacy/elm_code/src/tests/elm_code_suite.h deleted file mode 100644 index 750bfd7f18..0000000000 --- a/legacy/elm_code/src/tests/elm_code_suite.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _ELM_CODE_SUITE_H -#define _ELM_CODE_SUITE_H - -#include - -#define ck_assert_strn_eq(s1, s2, len) \ - { \ - char expected[len+1], actual[len+1]; \ -\ - strncpy(expected, s1, len); \ - expected[len] = '\0'; \ - strncpy(actual, s2, len); \ - actual[len] = '\0'; \ -\ - ck_assert_str_eq(expected, actual); \ - } - -#include - -void elm_code_file_test_load(TCase *tc); -void elm_code_file_test_memory(TCase *tc); -void elm_code_test_basic(TCase *tc); -void elm_code_test_line(TCase *tc); -void elm_code_test_parse(TCase *tc); -void elm_code_test_text(TCase *tc); -void elm_code_test_widget(TCase *tc); -void elm_code_test_widget_text(TCase *tc); -void elm_code_test_widget_selection(TCase *tc); -void elm_code_test_widget_undo(TCase *tc); - -#endif /* _EDLM_CODE_SUITE_H */ diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 550a54a36a..c122a75bec 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -135,6 +135,7 @@ elm_public_eolian_files = \ lib/elementary/elm_progressbar_internal_part.eo \ lib/elementary/elm_popup_internal_part.eo \ lib/elementary/elm_scroller_internal_part.eo \ + lib/elementary/elm_code_widget.eo \ $(NULL) # Legacy classes - not part of public EO API @@ -252,7 +253,16 @@ includesunstable_HEADERS = \ lib/elementary/elm_widget_thumb.h \ lib/elementary/elm_widget_toolbar.h \ lib/elementary/elm_widget_video.h \ - lib/elementary/elm_widget_web.h + lib/elementary/elm_widget_web.h \ + lib/elementary/elm_code.h \ + lib/elementary/elm_code_widget_legacy.h \ + lib/elementary/elm_code_widget_selection.h \ + lib/elementary/elm_code_diff_widget.h \ + lib/elementary/elm_code_common.h \ + lib/elementary/elm_code_line.h \ + lib/elementary/elm_code_text.h \ + lib/elementary/elm_code_file.h \ + lib/elementary/elm_code_parse.h includesunstabledir = $(includedir)/elementary-@VMAJ@ nodist_includesunstable_HEADERS = \ @@ -562,6 +572,16 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/elm_check.c \ lib/elementary/elm_clock.c \ lib/elementary/elm_cnp.c \ + lib/elementary/elm_code_line.c \ + lib/elementary/elm_code_text.c \ + lib/elementary/elm_code_file.c \ + lib/elementary/elm_code_parse.c \ + lib/elementary/elm_code_widget_selection.c \ + lib/elementary/elm_code_widget.c \ + lib/elementary/elm_code_diff_widget.c \ + lib/elementary/elm_code.c \ + lib/elementary/elm_code_private.h \ + lib/elementary/elm_code_widget_private.h \ lib/elementary/elm_colorselector.c \ lib/elementary/elm_color_class.c \ lib/elementary/elc_combobox.c \ @@ -1214,6 +1234,11 @@ edje_external_elementary_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ edje_external_elementary_module_la_LIBTOOLFLAGS = --tag=disable-static ### Tests +EXTRA_DIST += \ +tests/elementary/testfile.txt \ +tests/elementary/testfile-windows.txt \ +tests/elementary/testfile-withblanks.txt \ +tests/elementary/testdiff.diff if EFL_ENABLE_TESTS @@ -1291,12 +1316,24 @@ tests_elementary_elm_suite_SOURCES = \ tests/elementary/elm_test_panes.c \ tests/elementary/elm_test_slideshow.c \ tests/elementary/elm_test_spinner.c \ - tests/elementary/elm_test_plug.c + tests/elementary/elm_test_plug.c \ + tests/elementary/elm_code_file_test_load.c \ + tests/elementary/elm_code_file_test_memory.c \ + tests/elementary/elm_code_test_basic.c \ + tests/elementary/elm_code_test_line.c \ + tests/elementary/elm_code_test_parse.c \ + tests/elementary/elm_code_test_text.c \ + tests/elementary/elm_code_test_widget.c \ + tests/elementary/elm_code_test_widget_text.c \ + tests/elementary/elm_code_test_widget_selection.c \ + tests/elementary/elm_code_test_widget_undo.c tests_elementary_elm_suite_CPPFLAGS = \ -DTESTS_BUILD_DIR=\"${top_builddir}/src/tests/elementary\" \ + -DTESTS_SRC_DIR=\"${top_srcdir}/src/tests/elementary\" \ -DELM_IMAGE_DATA_DIR=\"${top_srcdir}/data/elementary\" \ -DELM_TEST_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \ + -DPACKAGE_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \ -I$(top_srcdir)/src/lib/elementary \ -I$(top_builddir)/src/lib/elementary \ @CHECK_CFLAGS@ \ @@ -1339,4 +1376,7 @@ tests/elementary/elm_suite.h \ tests/elementary/elm_test_helper.h \ lib/elementary/Makefile.am \ lib/elementary/Makefile.in \ -lib/elementary/Elementary.h.in +lib/elementary/Elementary.h.in \ +lib/elementary/elm_code_widget_text.c \ +lib/elementary/elm_code_widget_undo.c + diff --git a/src/lib/elementary/Elementary.h.in b/src/lib/elementary/Elementary.h.in index b85eaffaec..59d4081cea 100644 --- a/src/lib/elementary/Elementary.h.in +++ b/src/lib/elementary/Elementary.h.in @@ -202,6 +202,7 @@ EAPI extern Elm_Version *elm_version; #include #include #include +#include #include #include #include diff --git a/legacy/elm_code/src/lib/elm_code.c b/src/lib/elementary/elm_code.c similarity index 97% rename from legacy/elm_code/src/lib/elm_code.c rename to src/lib/elementary/elm_code.c index 598f928622..ff26ea063e 100644 --- a/legacy/elm_code/src/lib/elm_code.c +++ b/src/lib/elementary/elm_code.c @@ -1,11 +1,11 @@ #ifdef HAVE_CONFIG -# include "config.h" +# include "elementary_config.h" #endif #include #include -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_private.h" diff --git a/legacy/elm_code/src/lib/Elm_Code.h b/src/lib/elementary/elm_code.h similarity index 77% rename from legacy/elm_code/src/lib/Elm_Code.h rename to src/lib/elementary/elm_code.h index 9d14b400ec..046cb6e965 100644 --- a/legacy/elm_code/src/lib/Elm_Code.h +++ b/src/lib/elementary/elm_code.h @@ -1,46 +1,14 @@ #ifndef ELM_CODE_H_ # define ELM_CODE_H_ -#include -#include -#include -#define ELM_INTERNAL_API_ARGESFSDFEFC -#include - -#ifdef EAPI -# undef EAPI -#endif - -#ifdef _WIN32 -# ifdef EFL_ELM_CODE_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif /* ! DLL_EXPORT */ -# else -# define EAPI __declspec(dllimport) -# endif /* ! EFL_ELM_CODE_BUILD */ -#else -# ifdef __GNUC__ -# if __GNUC__ >= 4 -# define EAPI __attribute__ ((visibility("default"))) -# else -# define EAPI -# endif -# else -# define EAPI -# endif -#endif /* ! _WIN32 */ - #include "elm_code_common.h" #include "elm_code_line.h" #include "elm_code_text.h" #include "elm_code_file.h" #include "elm_code_parse.h" -#include "widget/elm_code_widget.eo.h" -#include "widget/elm_code_widget_legacy.h" -#include "widget/elm_code_widget_selection.h" +#include "elm_code_widget.eo.h" +#include "elm_code_widget_legacy.h" +#include "elm_code_widget_selection.h" #include "elm_code_diff_widget.h" #ifdef __cplusplus diff --git a/legacy/elm_code/src/lib/elm_code_common.h b/src/lib/elementary/elm_code_common.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_common.h rename to src/lib/elementary/elm_code_common.h diff --git a/legacy/elm_code/src/lib/elm_code_diff_widget.c b/src/lib/elementary/elm_code_diff_widget.c similarity index 98% rename from legacy/elm_code/src/lib/elm_code_diff_widget.c rename to src/lib/elementary/elm_code_diff_widget.c index 7efb84894c..c874805cab 100644 --- a/legacy/elm_code/src/lib/elm_code_diff_widget.c +++ b/src/lib/elementary/elm_code_diff_widget.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_private.h" diff --git a/legacy/elm_code/src/lib/elm_code_diff_widget.h b/src/lib/elementary/elm_code_diff_widget.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_diff_widget.h rename to src/lib/elementary/elm_code_diff_widget.h diff --git a/legacy/elm_code/src/lib/elm_code_file.c b/src/lib/elementary/elm_code_file.c similarity index 99% rename from legacy/elm_code/src/lib/elm_code_file.c rename to src/lib/elementary/elm_code_file.c index 5db1bfa9f2..4e8dee46b0 100644 --- a/legacy/elm_code/src/lib/elm_code_file.c +++ b/src/lib/elementary/elm_code_file.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_private.h" @@ -319,4 +319,3 @@ EAPI Elm_Code_Line *elm_code_file_line_get(Elm_Code_File *file, unsigned int num { return eina_list_nth(file->lines, number - 1); } - diff --git a/legacy/elm_code/src/lib/elm_code_file.h b/src/lib/elementary/elm_code_file.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_file.h rename to src/lib/elementary/elm_code_file.h diff --git a/legacy/elm_code/src/lib/elm_code_line.c b/src/lib/elementary/elm_code_line.c similarity index 98% rename from legacy/elm_code/src/lib/elm_code_line.c rename to src/lib/elementary/elm_code_line.c index b2ee71419a..2b3281de66 100644 --- a/legacy/elm_code/src/lib/elm_code_line.c +++ b/src/lib/elementary/elm_code_line.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_private.h" diff --git a/legacy/elm_code/src/lib/elm_code_line.h b/src/lib/elementary/elm_code_line.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_line.h rename to src/lib/elementary/elm_code_line.h diff --git a/legacy/elm_code/src/lib/elm_code_parse.c b/src/lib/elementary/elm_code_parse.c similarity index 98% rename from legacy/elm_code/src/lib/elm_code_parse.c rename to src/lib/elementary/elm_code_parse.c index f7fd97ee77..5869f8cf33 100644 --- a/legacy/elm_code/src/lib/elm_code_parse.c +++ b/src/lib/elementary/elm_code_parse.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_private.h" diff --git a/legacy/elm_code/src/lib/elm_code_parse.h b/src/lib/elementary/elm_code_parse.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_parse.h rename to src/lib/elementary/elm_code_parse.h diff --git a/legacy/elm_code/src/lib/elm_code_private.h b/src/lib/elementary/elm_code_private.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_private.h rename to src/lib/elementary/elm_code_private.h diff --git a/legacy/elm_code/src/lib/elm_code_text.c b/src/lib/elementary/elm_code_text.c similarity index 98% rename from legacy/elm_code/src/lib/elm_code_text.c rename to src/lib/elementary/elm_code_text.c index 901b6aefb9..f1503e7d09 100644 --- a/legacy/elm_code/src/lib/elm_code_text.c +++ b/src/lib/elementary/elm_code_text.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_private.h" diff --git a/legacy/elm_code/src/lib/elm_code_text.h b/src/lib/elementary/elm_code_text.h similarity index 100% rename from legacy/elm_code/src/lib/elm_code_text.h rename to src/lib/elementary/elm_code_text.h diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c similarity index 99% rename from legacy/elm_code/src/lib/widget/elm_code_widget.c rename to src/lib/elementary/elm_code_widget.c index 9af37bd6d8..9a9418e1ff 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -1,8 +1,11 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include + +#include "elm_priv.h" + #include "elm_code_private.h" #include "elm_code_widget_private.h" diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget.eo b/src/lib/elementary/elm_code_widget.eo similarity index 99% rename from legacy/elm_code/src/lib/widget/elm_code_widget.eo rename to src/lib/elementary/elm_code_widget.eo index 65dd56a780..2a977ab9ea 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget.eo +++ b/src/lib/elementary/elm_code_widget.eo @@ -1,6 +1,7 @@ import evas_types; import edje_types; import elm_interface_scrollable; +import elm_general; struct @extern Elm_Code; /* The main interface currently defined in code */ struct @extern Elm_Code_Line; /* Parts of the interface currently defined in code */ diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget_legacy.h b/src/lib/elementary/elm_code_widget_legacy.h similarity index 86% rename from legacy/elm_code/src/lib/widget/elm_code_widget_legacy.h rename to src/lib/elementary/elm_code_widget_legacy.h index 450f4adeae..5110e301e2 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget_legacy.h +++ b/src/lib/elementary/elm_code_widget_legacy.h @@ -10,4 +10,4 @@ */ EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code); -#include "widget/elm_code_widget.eo.legacy.h" +#include "elm_code_widget.eo.legacy.h" diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget_private.h b/src/lib/elementary/elm_code_widget_private.h similarity index 100% rename from legacy/elm_code/src/lib/widget/elm_code_widget_private.h rename to src/lib/elementary/elm_code_widget_private.h diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget_selection.c b/src/lib/elementary/elm_code_widget_selection.c similarity index 99% rename from legacy/elm_code/src/lib/widget/elm_code_widget_selection.c rename to src/lib/elementary/elm_code_widget_selection.c index 9e82ac5456..33da3aaf9b 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget_selection.c +++ b/src/lib/elementary/elm_code_widget_selection.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_widget_private.h" diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget_selection.h b/src/lib/elementary/elm_code_widget_selection.h similarity index 100% rename from legacy/elm_code/src/lib/widget/elm_code_widget_selection.h rename to src/lib/elementary/elm_code_widget_selection.h diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget_text.c b/src/lib/elementary/elm_code_widget_text.c similarity index 98% rename from legacy/elm_code/src/lib/widget/elm_code_widget_text.c rename to src/lib/elementary/elm_code_widget_text.c index 3689e8284a..bbcbdc3492 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget_text.c +++ b/src/lib/elementary/elm_code_widget_text.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_widget_private.h" diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget_undo.c b/src/lib/elementary/elm_code_widget_undo.c similarity index 95% rename from legacy/elm_code/src/lib/widget/elm_code_widget_undo.c rename to src/lib/elementary/elm_code_widget_undo.c index 1eaceaaedc..ccf621b300 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget_undo.c +++ b/src/lib/elementary/elm_code_widget_undo.c @@ -1,8 +1,8 @@ -#ifdef HAVE_CONFIG -# include "config.h" +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" #endif -#include "Elm_Code.h" +#include "Elementary.h" #include "elm_code_widget_private.h" diff --git a/legacy/elm_code/src/tests/elm_code_file_test_load.c b/src/tests/elementary/elm_code_file_test_load.c similarity index 80% rename from legacy/elm_code/src/tests/elm_code_file_test_load.c rename to src/tests/elementary/elm_code_file_test_load.c index 02a6f7ee74..7e21b235f1 100644 --- a/legacy/elm_code/src/tests/elm_code_file_test_load.c +++ b/src/tests/elementary/elm_code_file_test_load.c @@ -1,16 +1,20 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" START_TEST (elm_code_file_load) { - char *path = TESTS_DIR "testfile.txt"; + char *path = TESTS_SRC_DIR "/testfile.txt"; char real[EINA_PATH_MAX]; Elm_Code_File *file; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); realpath(path, real); @@ -19,51 +23,58 @@ START_TEST (elm_code_file_load) ck_assert_str_eq(real, elm_code_file_path_get(file)); elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST START_TEST (elm_code_file_load_lines) { - char *path = TESTS_DIR "testfile.txt"; + char *path = TESTS_SRC_DIR "/testfile.txt"; Elm_Code_File *file; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); ck_assert_uint_eq(4, elm_code_file_lines_get(file)); elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST START_TEST (elm_code_file_load_blank_lines) { - char *path = TESTS_DIR "testfile-withblanks.txt"; + char *path = TESTS_SRC_DIR "/testfile-withblanks.txt"; Elm_Code_File *file; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); ck_assert_uint_eq(8, elm_code_file_lines_get(file)); elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST START_TEST (elm_code_file_load_windows) { - char *path = TESTS_DIR "testfile-windows.txt"; + char *path = TESTS_SRC_DIR "/testfile-windows.txt"; Elm_Code_File *file; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); ck_assert_uint_eq(4, elm_code_file_lines_get(file)); elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -81,10 +92,11 @@ static void _assert_line_content_eq(const char *content, Elm_Code_Line *line) START_TEST (elm_code_file_load_content) { - char *path = TESTS_DIR "testfile.txt"; + char *path = TESTS_SRC_DIR "/testfile.txt"; Elm_Code_File *file; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); @@ -92,16 +104,18 @@ START_TEST (elm_code_file_load_content) _assert_line_content_eq("another line", elm_code_file_line_get(file, 4)); elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST START_TEST (elm_code_file_line_ending_unix) { - char *path = TESTS_DIR "testfile.txt"; + char *path = TESTS_SRC_DIR "/testfile.txt"; Elm_Code_File *file; Elm_Code *code; short len; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); @@ -111,16 +125,18 @@ START_TEST (elm_code_file_line_ending_unix) elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST START_TEST (elm_code_file_line_ending_windows) { - char *path = TESTS_DIR "testfile-windows.txt"; + char *path = TESTS_SRC_DIR "/testfile-windows.txt"; Elm_Code_File *file; Elm_Code *code; short len; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_open(code, path); @@ -130,6 +146,7 @@ START_TEST (elm_code_file_line_ending_windows) elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -143,4 +160,3 @@ void elm_code_file_test_load(TCase *tc) tcase_add_test(tc, elm_code_file_line_ending_unix); tcase_add_test(tc, elm_code_file_line_ending_windows); } - diff --git a/legacy/elm_code/src/tests/elm_code_file_test_memory.c b/src/tests/elementary/elm_code_file_test_memory.c similarity index 82% rename from legacy/elm_code/src/tests/elm_code_file_test_memory.c rename to src/tests/elementary/elm_code_file_test_memory.c index b82ce2eda2..f39228d427 100644 --- a/legacy/elm_code/src/tests/elm_code_file_test_memory.c +++ b/src/tests/elementary/elm_code_file_test_memory.c @@ -1,13 +1,17 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" START_TEST (elm_code_file_memory_lines) { Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); ck_assert_uint_eq(0, elm_code_file_lines_get(code->file)); @@ -15,6 +19,7 @@ START_TEST (elm_code_file_memory_lines) ck_assert_uint_eq(1, elm_code_file_lines_get(code->file)); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -24,6 +29,7 @@ START_TEST (elm_code_file_memory_tokens) Elm_Code_Line *line; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); file = code->file; elm_code_file_line_append(file, "a line", 6, NULL); @@ -32,6 +38,7 @@ START_TEST (elm_code_file_memory_tokens) elm_code_line_token_add(line, 2, 5, 1, ELM_CODE_TOKEN_TYPE_COMMENT); ck_assert_uint_eq(1, eina_list_count(line->tokens)); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -40,4 +47,3 @@ void elm_code_file_test_memory(TCase *tc) tcase_add_test(tc, elm_code_file_memory_lines); tcase_add_test(tc, elm_code_file_memory_tokens); } - diff --git a/legacy/elm_code/src/tests/elm_code_test_basic.c b/src/tests/elementary/elm_code_test_basic.c similarity index 59% rename from legacy/elm_code/src/tests/elm_code_test_basic.c rename to src/tests/elementary/elm_code_test_basic.c index b968e90523..9805a7508b 100644 --- a/legacy/elm_code/src/tests/elm_code_test_basic.c +++ b/src/tests/elementary/elm_code_test_basic.c @@ -1,19 +1,24 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" START_TEST (elm_code_create_test) { - char *path = "elm_code/src/tests/testfile.txt"; + char *path = TESTS_SRC_DIR "/testfile.txt"; Elm_Code *code; + elm_init(1, NULL); code = elm_code_create(); elm_code_file_open(code, path); ck_assert(!!code); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -21,4 +26,3 @@ void elm_code_test_basic(TCase *tc) { tcase_add_test(tc, elm_code_create_test); } - diff --git a/legacy/elm_code/src/tests/elm_code_test_line.c b/src/tests/elementary/elm_code_test_line.c similarity index 88% rename from legacy/elm_code/src/tests/elm_code_test_line.c rename to src/tests/elementary/elm_code_test_line.c index b19bf615c3..cdbc628079 100644 --- a/legacy/elm_code/src/tests/elm_code_test_line.c +++ b/src/tests/elementary/elm_code_test_line.c @@ -1,8 +1,11 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" START_TEST (elm_code_line_create_test) { @@ -10,6 +13,7 @@ START_TEST (elm_code_line_create_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -19,6 +23,7 @@ START_TEST (elm_code_line_create_test) ck_assert(!!line); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -28,6 +33,7 @@ START_TEST (elm_code_line_token_count_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -41,6 +47,7 @@ START_TEST (elm_code_line_token_count_test) ck_assert_int_eq(0, eina_list_count(line->tokens)); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -50,6 +57,7 @@ START_TEST (elm_code_line_split_test) Elm_Code_File *file; Elm_Code_Line *line, *newline; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -63,6 +71,7 @@ START_TEST (elm_code_line_split_test) newline = elm_code_file_line_get(file, 2); ck_assert_int_eq(5, line->length); ck_assert_int_eq(5, newline->length); + elm_shutdown(); } END_TEST @@ -72,4 +81,3 @@ void elm_code_test_line(TCase *tc) tcase_add_test(tc, elm_code_line_token_count_test); tcase_add_test(tc, elm_code_line_split_test); } - diff --git a/legacy/elm_code/src/tests/elm_code_test_parse.c b/src/tests/elementary/elm_code_test_parse.c similarity index 88% rename from legacy/elm_code/src/tests/elm_code_test_parse.c rename to src/tests/elementary/elm_code_test_parse.c index e91845c3b5..4bd35b4b88 100644 --- a/legacy/elm_code/src/tests/elm_code_test_parse.c +++ b/src/tests/elementary/elm_code_test_parse.c @@ -1,8 +1,11 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" #include "elm_code_parse.h" static int line_calls, file_calls; @@ -25,6 +28,7 @@ START_TEST (elm_code_parse_hook_memory_test) line_calls = 0; file_calls = 0; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -35,6 +39,7 @@ START_TEST (elm_code_parse_hook_memory_test) ck_assert_int_eq(0, file_calls); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -42,11 +47,12 @@ START_TEST (elm_code_parse_hook_file_test) { Elm_Code *code; Elm_Code_File *file; - char *path = TESTS_DIR "testfile.txt"; + char *path = TESTS_SRC_DIR "testfile.txt"; line_calls = 0; file_calls = 0; + elm_init(1, NULL); code = elm_code_create(); elm_code_parser_add(code, _parser_line_callback, _parser_file_callback, NULL); @@ -57,6 +63,7 @@ START_TEST (elm_code_parse_hook_file_test) elm_code_file_close(file); elm_code_free(code); + elm_shutdown(); } END_TEST @@ -66,6 +73,7 @@ START_TEST (elm_code_parse_todo_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); elm_code_init(); code = elm_code_create(); @@ -82,6 +90,7 @@ START_TEST (elm_code_parse_todo_test) elm_code_line_text_set(line, "TOFIX", 5); ck_assert_int_eq(ELM_CODE_STATUS_TYPE_DEFAULT, line->status); elm_code_shutdown(); + elm_shutdown(); } END_TEST @@ -91,4 +100,3 @@ void elm_code_test_parse(TCase *tc) tcase_add_test(tc, elm_code_parse_hook_file_test); tcase_add_test(tc, elm_code_parse_todo_test); } - diff --git a/legacy/elm_code/src/tests/elm_code_test_text.c b/src/tests/elementary/elm_code_test_text.c similarity index 91% rename from legacy/elm_code/src/tests/elm_code_test_text.c rename to src/tests/elementary/elm_code_test_text.c index 26e1aa18de..934b98b425 100644 --- a/legacy/elm_code/src/tests/elm_code_test_text.c +++ b/src/tests/elementary/elm_code_test_text.c @@ -1,8 +1,11 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" #include "elm_code_text.h" START_TEST (elm_code_text_get_test) @@ -11,12 +14,14 @@ START_TEST (elm_code_text_get_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); elm_code_file_line_append(file, "test", 4, NULL); line = elm_code_file_line_get(file, 1); ck_assert_str_eq("test", elm_code_line_text_get(line, NULL)); + elm_shutdown(); } END_TEST @@ -26,6 +31,7 @@ START_TEST (elm_code_text_insert_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -34,6 +40,7 @@ START_TEST (elm_code_text_insert_test) elm_code_line_text_insert(line, 4, "ing", 3); ck_assert_str_eq("testing", elm_code_line_text_get(line, NULL)); + elm_shutdown(); } END_TEST @@ -43,6 +50,7 @@ START_TEST (elm_code_text_contains_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -54,6 +62,7 @@ START_TEST (elm_code_text_contains_test) ck_assert_int_eq(EINA_TRUE, elm_code_line_text_contains(line, "a t")); ck_assert_int_eq(EINA_TRUE, elm_code_line_text_contains(line, "...")); + elm_shutdown(); } END_TEST @@ -63,6 +72,7 @@ START_TEST (elm_code_text_strpos_test) Elm_Code_File *file; Elm_Code_Line *line; + elm_init(1, NULL); code = elm_code_create(); file = elm_code_file_new(code); @@ -78,6 +88,7 @@ START_TEST (elm_code_text_strpos_test) ck_assert_int_eq(0, elm_code_line_text_strpos(line, "a t", 0)); ck_assert_int_eq(ELM_CODE_TEXT_NOT_FOUND, elm_code_line_text_strpos(line, "a t", 2)); ck_assert_int_eq(13, elm_code_line_text_strpos(line, "...", 0)); + elm_shutdown(); } END_TEST @@ -87,10 +98,12 @@ START_TEST (elm_code_text_newline_position_test) const char *unixtext = "a test\nwith newline"; const char *wintext = "a windows\r\nnewline"; + elm_init(1, NULL); ck_assert_int_eq(6, elm_code_text_newlinenpos(unixtext, strlen(unixtext), &nllen)); ck_assert_int_eq(1, nllen); ck_assert_int_eq(9, elm_code_text_newlinenpos(wintext, strlen(wintext), &nllen)); ck_assert_int_eq(2, nllen); + elm_shutdown(); } END_TEST @@ -98,6 +111,7 @@ START_TEST (elm_code_text_leading_whitespace_test) { const char *text; + elm_init(1, NULL); text = "testing"; ck_assert_int_eq(0, elm_code_text_leading_whitespace_length(text, strlen(text))); @@ -109,6 +123,7 @@ START_TEST (elm_code_text_leading_whitespace_test) text = " \t mix"; ck_assert_int_eq(3, elm_code_text_leading_whitespace_length(text, strlen(text))); + elm_shutdown(); } END_TEST @@ -116,6 +131,7 @@ START_TEST (elm_code_text_trailing_whitespace_test) { const char *text; + elm_init(1, NULL); text = "testing"; ck_assert_int_eq(0, elm_code_text_trailing_whitespace_length(text, strlen(text))); @@ -127,6 +143,7 @@ START_TEST (elm_code_text_trailing_whitespace_test) text = "mix \t "; ck_assert_int_eq(3, elm_code_text_trailing_whitespace_length(text, strlen(text))); + elm_shutdown(); } END_TEST @@ -134,6 +151,7 @@ START_TEST (elm_code_text_is_whitespace_test) { const char *text; + elm_init(1, NULL); text = " "; ck_assert_int_eq(1, elm_code_text_is_whitespace(text, strlen(text))); @@ -142,6 +160,7 @@ START_TEST (elm_code_text_is_whitespace_test) text = " . "; ck_assert_int_eq(0, elm_code_text_is_whitespace(text, strlen(text))); + elm_shutdown(); } END_TEST diff --git a/legacy/elm_code/src/tests/widget/elm_code_test_widget.c b/src/tests/elementary/elm_code_test_widget.c similarity index 93% rename from legacy/elm_code/src/tests/widget/elm_code_test_widget.c rename to src/tests/elementary/elm_code_test_widget.c index 7f2303ff4d..660015363e 100644 --- a/legacy/elm_code/src/tests/widget/elm_code_test_widget.c +++ b/src/tests/elementary/elm_code_test_widget.c @@ -1,10 +1,12 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC -#include "widget/elm_code_widget.c" +#include "elm_suite.h" +#include "Elementary.h" +#include "elm_code_widget.c" static void _assert_cell_type(Evas_Textgrid_Cell cell, Elm_Code_Token_Type type, int id) { @@ -89,4 +91,3 @@ void elm_code_test_widget(TCase *tc) tcase_add_test(tc, elm_code_widget_construct); tcase_add_test(tc, elm_code_widget_construct_nocode); } - diff --git a/legacy/elm_code/src/tests/widget/elm_code_test_widget_selection.c b/src/tests/elementary/elm_code_test_widget_selection.c similarity index 98% rename from legacy/elm_code/src/tests/widget/elm_code_test_widget_selection.c rename to src/tests/elementary/elm_code_test_widget_selection.c index 9769f6bcd0..e181e6e14d 100644 --- a/legacy/elm_code/src/tests/widget/elm_code_test_widget_selection.c +++ b/src/tests/elementary/elm_code_test_widget_selection.c @@ -1,12 +1,13 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC +#include "elm_suite.h" +#include "Elementary.h" #include "elm_code_widget_private.h" - -#include "widget/elm_code_widget_selection.h" +#include "elm_code_widget_selection.h" START_TEST (elm_code_test_widget_selection_set) { @@ -502,6 +503,7 @@ START_TEST (elm_code_test_widget_selection_select_line) selection = elm_code_widget_selection_text_get(widget); ck_assert_str_eq("line2", selection); free(selection); + elm_shutdown(); } END_TEST @@ -536,6 +538,7 @@ START_TEST (elm_code_test_widget_selection_select_word) selection = elm_code_widget_selection_text_get(widget); ck_assert_str_eq("stuff", selection); free(selection); + elm_shutdown(); } END_TEST @@ -574,6 +577,7 @@ START_TEST (elm_code_test_widget_selection_select_word_punctuation) selection = elm_code_widget_selection_text_get(widget); ck_assert_str_eq("mark", selection); free(selection); + elm_shutdown(); } END_TEST @@ -612,6 +616,7 @@ START_TEST (elm_code_test_widget_selection_select_word_symbols) selection = elm_code_widget_selection_text_get(widget); ck_assert_str_eq("braces", selection); free(selection); + elm_shutdown(); } END_TEST @@ -636,4 +641,3 @@ void elm_code_test_widget_selection(TCase *tc) tcase_add_test(tc, elm_code_test_widget_selection_select_word_punctuation); tcase_add_test(tc, elm_code_test_widget_selection_select_word_symbols); } - diff --git a/legacy/elm_code/src/tests/widget/elm_code_test_widget_text.c b/src/tests/elementary/elm_code_test_widget_text.c similarity index 92% rename from legacy/elm_code/src/tests/widget/elm_code_test_widget_text.c rename to src/tests/elementary/elm_code_test_widget_text.c index 86d4a33e51..e11ce6fad4 100644 --- a/legacy/elm_code/src/tests/widget/elm_code_test_widget_text.c +++ b/src/tests/elementary/elm_code_test_widget_text.c @@ -1,8 +1,11 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC + +#include "elm_suite.h" +#include "Elementary.h" START_TEST (elm_code_test_widget_text_tab_width) { @@ -48,6 +51,7 @@ START_TEST (elm_code_test_widget_text_position) ck_assert_int_eq(2, elm_code_widget_line_text_position_for_column_get(widget, line, 9)); ck_assert_int_eq(1, elm_code_widget_line_text_position_for_column_get(widget, line, 7)); + elm_shutdown(); } END_TEST @@ -56,4 +60,3 @@ void elm_code_test_widget_text(TCase *tc) tcase_add_test(tc, elm_code_test_widget_text_tab_width); tcase_add_test(tc, elm_code_test_widget_text_position); } - diff --git a/legacy/elm_code/src/tests/widget/elm_code_test_widget_undo.c b/src/tests/elementary/elm_code_test_widget_undo.c similarity index 97% rename from legacy/elm_code/src/tests/widget/elm_code_test_widget_undo.c rename to src/tests/elementary/elm_code_test_widget_undo.c index 0de2cb91a5..b07a294eb5 100644 --- a/legacy/elm_code/src/tests/widget/elm_code_test_widget_undo.c +++ b/src/tests/elementary/elm_code_test_widget_undo.c @@ -1,9 +1,11 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +# include "elementary_config.h" #endif -#include "elm_code_suite.h" +#define ELM_INTERNAL_API_ARGESFSDFEFC +#include "elm_suite.h" +#include "Elementary.h" #include "elm_code_widget_private.h" START_TEST (elm_code_test_widget_undo_text_insert) @@ -161,4 +163,3 @@ void elm_code_test_widget_undo(TCase *tc) tcase_add_test(tc, elm_code_test_widget_undo_newline); tcase_add_test(tc, elm_code_test_widget_undo_delete); } - diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c index 75facc6e37..a612e7edc3 100644 --- a/src/tests/elementary/elm_suite.c +++ b/src/tests/elementary/elm_suite.c @@ -71,6 +71,15 @@ static const Efl_Test_Case etc[] = { { "elm_slideshow", elm_test_slideshow}, { "elm_spinner", elm_test_spinner}, { "elm_plug", elm_test_plug}, + { "file_load", elm_code_file_test_load }, + { "file_memory", elm_code_file_test_memory }, + { "parse", elm_code_test_parse }, + { "text", elm_code_test_text }, + { "basic", elm_code_test_basic }, + { "widget", elm_code_test_widget }, + { "widget_text", elm_code_test_widget_text }, + { "widget_selection", elm_code_test_widget_selection }, + { "widget_undo", elm_code_test_widget_undo }, { NULL, NULL } }; diff --git a/src/tests/elementary/elm_suite.h b/src/tests/elementary/elm_suite.h index 1a191793bf..bf87d1b622 100644 --- a/src/tests/elementary/elm_suite.h +++ b/src/tests/elementary/elm_suite.h @@ -69,4 +69,15 @@ void elm_test_slideshow(TCase *tc); void elm_test_spinner(TCase *tc); void elm_test_plug(TCase *tc); +void elm_code_file_test_load(TCase *tc); +void elm_code_file_test_memory(TCase *tc); +void elm_code_test_basic(TCase *tc); +void elm_code_test_line(TCase *tc); +void elm_code_test_parse(TCase *tc); +void elm_code_test_text(TCase *tc); +void elm_code_test_widget(TCase *tc); +void elm_code_test_widget_text(TCase *tc); +void elm_code_test_widget_selection(TCase *tc); +void elm_code_test_widget_undo(TCase *tc); + #endif /* _ELM_SUITE_H */ diff --git a/src/tests/elementary/elm_test_helper.h b/src/tests/elementary/elm_test_helper.h index 0bfc5ca0e6..f0b44bb8ed 100644 --- a/src/tests/elementary/elm_test_helper.h +++ b/src/tests/elementary/elm_test_helper.h @@ -3,6 +3,19 @@ #include +#define ck_assert_strn_eq(s1, s2, len) \ + { \ + char expected[len+1], actual[len+1]; \ + \ + strncpy(expected, s1, len); \ + expected[len] = '\0'; \ + strncpy(actual, s2, len); \ + actual[len] = '\0'; \ + \ + ck_assert_str_eq(expected, actual); \ + } + + Eina_Bool elm_test_helper_wait_flag(double in, Eina_Bool *done); #endif /* _ELM_TEST_HELPER_H */ diff --git a/legacy/elm_code/src/tests/testdiff.diff b/src/tests/elementary/testdiff.diff similarity index 100% rename from legacy/elm_code/src/tests/testdiff.diff rename to src/tests/elementary/testdiff.diff diff --git a/legacy/elm_code/src/tests/testfile-windows.txt b/src/tests/elementary/testfile-windows.txt similarity index 100% rename from legacy/elm_code/src/tests/testfile-windows.txt rename to src/tests/elementary/testfile-windows.txt diff --git a/legacy/elm_code/src/tests/testfile-withblanks.txt b/src/tests/elementary/testfile-withblanks.txt similarity index 100% rename from legacy/elm_code/src/tests/testfile-withblanks.txt rename to src/tests/elementary/testfile-withblanks.txt diff --git a/legacy/elm_code/src/tests/testfile.txt b/src/tests/elementary/testfile.txt similarity index 100% rename from legacy/elm_code/src/tests/testfile.txt rename to src/tests/elementary/testfile.txt