summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-30 14:38:42 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-09-30 14:38:42 +0100
commitbe454ea912c3cecaa2268627b207ddac61739fb5 (patch)
tree3938adc8c4dce073c6d9b5ace8dfd56e4160c424
parent38e750b531379fe8fec399d37ca6b33248488dc9 (diff)
check first param for max number of runs
-rw-r--r--compbench.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/compbench.c b/compbench.c
index 86fef0d..d407f14 100644
--- a/compbench.c
+++ b/compbench.c
@@ -1,5 +1,6 @@
1#include <Elementary.h> 1#include <Elementary.h>
2#include <Efx.h> 2#include <Efx.h>
3#include <errno.h>
3 4
4/* screen size 5/* screen size
5 * broken for multimonitor 6 * broken for multimonitor
@@ -8,11 +9,15 @@ static int sw, sh;
8 9
9static Evas_Object *win, *rect; 10static Evas_Object *win, *rect;
10 11
12static unsigned int max, num = 0;
13
11static void _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED); 14static void _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED);
12 15
13static void 16static void
14_reset(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED) 17_reset(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o EINA_UNUSED)
15{ 18{
19 num++;
20 if (max && (num == max)) ecore_main_loop_quit();
16 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL); 21 efx_resize(rect, EFX_EFFECT_SPEED_LINEAR, NULL, 100, 100, 10.0, _resize1, NULL);
17} 22}
18 23
@@ -116,6 +121,12 @@ _resize1(void *data EINA_UNUSED, Efx_Map_Data *emd EINA_UNUSED, Evas_Object *o E
116int 121int
117main(int argc, char *argv[]) 122main(int argc, char *argv[])
118{ 123{
124 if (argc == 2)
125 {
126 errno = 0;
127 max = strtoul(argv[1], NULL, 10);
128 if (errno) max = 0;
129 }
119 elm_init(argc, argv); 130 elm_init(argc, argv);
120 efx_init(); 131 efx_init();
121 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 132 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);