summaryrefslogtreecommitdiff
path: root/src/tests/emile
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-03-17 08:51:01 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-17 09:58:21 +0100
commitf875f759ca71428fd2d7e2943ba086c5f45c877f (patch)
tree0e859326b4b1a6d01e60bcec79bf6f4e4ca144cc /src/tests/emile
parentaa3b6615ee60180708d27e64b0ef0b4f04cbbcc1 (diff)
emile: fix coding style with ecrustify.
Diffstat (limited to 'src/tests/emile')
-rw-r--r--src/tests/emile/emile_suite.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/tests/emile/emile_suite.c b/src/tests/emile/emile_suite.c
index 2663bceaff..8df7c73652 100644
--- a/src/tests/emile/emile_suite.c
+++ b/src/tests/emile/emile_suite.c
@@ -1,5 +1,5 @@
1#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
2# include <config.h> 2#include <config.h>
3#endif /* ifdef HAVE_CONFIG_H */ 3#endif /* ifdef HAVE_CONFIG_H */
4 4
5#include <stdlib.h> 5#include <stdlib.h>
@@ -23,11 +23,14 @@ emile_base_test(TCase *tc)
23 tcase_add_test(tc, emile_test_init); 23 tcase_add_test(tc, emile_test_init);
24} 24}
25 25
26static const struct { 26static const struct
27{
27 const char *name; 28 const char *name;
28 void (*build)(TCase *tc); 29 void (*build)(TCase *tc);
29} tests[] = { 30} tests[] = {
30 { "Emile_Base", emile_base_test } 31 {
32 "Emile_Base", emile_base_test
33 }
31}; 34};
32 35
33static void 36static void
@@ -36,16 +39,18 @@ _list_tests(void)
36 unsigned int i; 39 unsigned int i;
37 40
38 fputs("Available tests cases :\n", stderr); 41 fputs("Available tests cases :\n", stderr);
39 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) 42 for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
40 fprintf(stderr, "\t%s\n", tests[i].name); 43 fprintf(stderr, "\t%s\n", tests[i].name);
41} 44}
42 45
43static Eina_Bool 46static Eina_Bool
44_use_test(const char *name, int argc, char *argv[]) 47_use_test(const char *name, int argc, char *argv[])
45{ 48{
46 argc--; argv--; 49 argc--;
50 argv--;
47 51
48 if (argc < 1) return EINA_TRUE; 52 if (argc < 1)
53 return EINA_TRUE;
49 54
50 for (; argc > 1; argc--, argv++) 55 for (; argc > 1; argc--, argv++)
51 if (strcmp(name, *argv) == 0) 56 if (strcmp(name, *argv) == 0)
@@ -63,16 +68,13 @@ main(int argc, char *argv[])
63 int j; 68 int j;
64 69
65 for (j = 1; j < argc; j++) 70 for (j = 1; j < argc; j++)
66 if ((strcmp(argv[j], "-h") == 0) || 71 if ((strcmp(argv[j], "-h") == 0) || (strcmp(argv[j], "--help") == 0))
67 (strcmp(argv[j], "--help") == 0))
68 { 72 {
69 fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n", 73 fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n", argv[0]);
70 argv[0]);
71 _list_tests(); 74 _list_tests();
72 return 0; 75 return 0;
73 } 76 }
74 else if ((strcmp(argv[j], "-l") == 0) || 77 else if ((strcmp(argv[j], "-l") == 0) || (strcmp(argv[j], "--list") == 0))
75 (strcmp(argv[j], "--list") == 0))
76 { 78 {
77 _list_tests(); 79 _list_tests();
78 return 0; 80 return 0;
@@ -80,11 +82,12 @@ main(int argc, char *argv[])
80 82
81 s = suite_create("Emile"); 83 s = suite_create("Emile");
82 84
83 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) 85 for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i)
84 { 86 {
85 TCase *tc; 87 TCase *tc;
86 88
87 if (!_use_test(tests[i].name, argc, argv)) continue ; 89 if (!_use_test(tests[i].name, argc, argv))
90 continue;
88 91
89 tc = tcase_create(tests[i].name); 92 tc = tcase_create(tests[i].name);
90 tests[i].build(tc); 93 tests[i].build(tc);