summaryrefslogtreecommitdiff
path: root/src/tests/elua
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-03-27 13:51:13 -0400
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-05 11:10:26 +0200
commit624925fe6e9c72c639d47135d5ea70d4110ac1fe (patch)
treeb57c12a611bf3b4b492327a7fcb5722cd39dad5b /src/tests/elua
parent730020c7d4a87daf60cbfbb3a0a912b4f75d8cb5 (diff)
tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions in most cases, and many did not properly do this anyway see followup commit which resolves some issues with eina tests ref T6813 ref T6811 Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Diffstat (limited to 'src/tests/elua')
-rw-r--r--src/tests/elua/elua_lib.c4
-rw-r--r--src/tests/elua/elua_suite.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c
index b14323c431..4f53e7d869 100644
--- a/src/tests/elua/elua_lib.c
+++ b/src/tests/elua/elua_lib.c
@@ -25,8 +25,6 @@ EFL_START_TEST(elua_api)
25 cargv[1] = arg2; 25 cargv[1] = arg2;
26 char *spath = NULL; 26 char *spath = NULL;
27 27
28 fail_if(!elua_init());
29
30 st = elua_state_new("test"); 28 st = elua_state_new("test");
31 fail_if(!st); 29 fail_if(!st);
32 30
@@ -127,8 +125,6 @@ EFL_START_TEST(elua_api)
127 fail_if(remove(buf)); 125 fail_if(remove(buf));
128 126
129 elua_state_free(st); 127 elua_state_free(st);
130
131 elua_shutdown();
132} 128}
133EFL_END_TEST 129EFL_END_TEST
134 130
diff --git a/src/tests/elua/elua_suite.c b/src/tests/elua/elua_suite.c
index 1ad5ac164b..0ed47f87b5 100644
--- a/src/tests/elua/elua_suite.c
+++ b/src/tests/elua/elua_suite.c
@@ -4,12 +4,23 @@
4 4
5#include "elua_suite.h" 5#include "elua_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Elua.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Elua Library", elua_lib_test}, 10 { "Elua Library", elua_lib_test},
10 { NULL, NULL } 11 { NULL, NULL }
11}; 12};
12 13
14SUITE_INIT(elua)
15{
16 ck_assert_int_eq(elua_init(), 1);
17}
18
19SUITE_SHUTDOWN(elua)
20{
21 ck_assert_int_eq(elua_shutdown(), 0);
22}
23
13int 24int
14main(int argc, char **argv) 25main(int argc, char **argv)
15{ 26{
@@ -25,7 +36,7 @@ main(int argc, char **argv)
25#endif 36#endif
26 37
27 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 38 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
28 "Elua", etc); 39 "Elua", etc, SUITE_INIT_FN(elua), SUITE_SHUTDOWN_FN(elua));
29 40
30 return (failed_count == 0) ? 0 : 255; 41 return (failed_count == 0) ? 0 : 255;
31} 42}