summaryrefslogtreecommitdiff
path: root/src/tests/eina/eina_suite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eina/eina_suite.c')
-rw-r--r--src/tests/eina/eina_suite.c95
1 files changed, 57 insertions, 38 deletions
diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c
index 8e833356f3..dfa2bd1e5f 100644
--- a/src/tests/eina/eina_suite.c
+++ b/src/tests/eina/eina_suite.c
@@ -32,17 +32,17 @@
#include "../efl_check.h"
static const Efl_Test_Case etc[] = {
- { "FixedPoint", eina_test_fp },
+ { "fp", eina_test_fp },
{ "Inarray", eina_test_inarray },
{ "Array", eina_test_array },
- { "Binary Share", eina_test_binshare },
- { "String Share", eina_test_stringshare },
- { "UString Share", eina_test_ustringshare },
+ { "binshare", eina_test_binshare },
+ { "stringshare", eina_test_stringshare },
+ { "ustringshare", eina_test_ustringshare },
{ "Log", eina_test_log },
{ "Error", eina_test_error },
{ "Magic", eina_test_magic },
{ "Inlist", eina_test_inlist },
- { "Lazy alloc", eina_test_lalloc },
+ { "lalloc", eina_test_lalloc },
{ "Main", eina_test_main },
{ "Counter", eina_test_counter },
{ "Hash", eina_test_hash },
@@ -57,19 +57,19 @@ static const Efl_Test_Case etc[] = {
{ "Benchmark", eina_test_benchmark },
{ "Mempool", eina_test_mempool },
{ "Rectangle", eina_test_rectangle },
- { "Matrix Sparse", eina_test_matrixsparse },
- { "Eina Tiler", eina_test_tiler },
- { "Eina Strbuf", eina_test_strbuf },
- { "Eina Binbuf", eina_test_binbuf },
+ { "MatrixSparse", eina_test_matrixsparse },
+ { "Tiler", eina_test_tiler },
+ { "Strbuf", eina_test_strbuf },
+ { "Binbuf", eina_test_binbuf },
{ "String", eina_test_str },
- { "Unicode String", eina_test_ustr },
+ { "ustr", eina_test_ustr },
{ "QuadTree", eina_test_quadtree },
{ "Sched", eina_test_sched },
{ "Simple Xml Parser", eina_test_simple_xml_parser},
{ "Value", eina_test_value },
{ "COW", eina_test_cow },
{ "Barrier", eina_test_barrier },
- { "Tmp String", eina_test_tmpstr },
+ { "TmpStr", eina_test_tmpstr },
{ "Locking", eina_test_locking },
{ "ABI", eina_test_abi },
{ "Trash", eina_test_trash },
@@ -86,41 +86,47 @@ static const Efl_Test_Case etc[] = {
{ "Slice", eina_test_slice },
{ "Free Queue", eina_test_freeq },
{ "Util", eina_test_util },
- { "Short Lived Strings", eina_test_slstr },
+ { "slstr", eina_test_slstr },
+ { "Vpath", eina_test_vpath },
+ { "debug", eina_test_debug },
{ NULL, NULL }
};
-/* FIXME this is a copy from eina_test_mempool
- * we should remove the duplication
- */
static Eina_Array *_modules;
-static void _mempool_init(void)
+
+SUITE_INIT(eina)
{
- eina_init();
- /* force modules to be loaded in case they are not installed */
- _modules = eina_module_list_get(NULL,
- PACKAGE_BUILD_DIR "/src/modules",
- EINA_TRUE,
- NULL,
- NULL);
+ ck_assert_int_eq(eina_init(), 1);
+}
+
+SUITE_SHUTDOWN(eina)
+{
+ ck_assert_int_eq(eina_shutdown(), 0);
+}
+
+EFL_START_TEST(mempool_module_load)
+{
+ _modules = eina_module_list_get(NULL,
+ PACKAGE_BUILD_DIR "/src/modules/eina",
+ EINA_TRUE,
+ NULL,
+ NULL);
eina_module_list_load(_modules);
+ eina_module_list_unload(_modules);
}
+EFL_END_TEST
-static void _mempool_shutdown(void)
+static void
+mempool_init(TCase *tc)
{
- unsigned int i;
- Eina_Array_Iterator it;
- Eina_Module *module;
- eina_module_list_free(_modules);
- if (_modules)
- {
- EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
- free(module);
- eina_array_free(_modules);
- }
- eina_shutdown();
+ tcase_add_test(tc, mempool_module_load);
}
+static const Efl_Test_Case mp_etc[] = {
+ { "mempool_init", mempool_init },
+ { NULL, NULL },
+};
+
int
main(int argc, char **argv)
{
@@ -132,13 +138,26 @@ main(int argc, char **argv)
#ifdef NEED_RUN_IN_TREE
putenv("EFL_RUN_IN_TREE=1");
#endif
+ /* force modules to be loaded in case they are not installed
+ * this function does not require eina_init to be called
+ */
- _mempool_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
- "Eina", etc);
+ "eina_init_module", mp_etc, SUITE_INIT_FN(eina), SUITE_SHUTDOWN_FN(eina));
+
+ eina_init();
+ eina_module_list_load(_modules);
+ failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
+ "Eina", etc, NULL, NULL);
- _mempool_shutdown();
+ if (_modules)
+ {
+ while (eina_array_count(_modules))
+ eina_module_free(eina_array_pop(_modules));
+ eina_array_free(_modules);
+ }
+ eina_shutdown();
return (failed_count == 0) ? 0 : 255;
}