From: Enlightenment S. <no-...@en...> - 2010-12-01 19:41:42
|
Log: fix up stress client a bit, and only do one call instead of both Author: discomfitor Date: 2010-12-01 11:41:35 -0800 (Wed, 01 Dec 2010) New Revision: 55124 Trac: http://trac.enlightenment.org/e/changeset/55124 Modified: trunk/PROTO/azy/src/tests/stress_client.c trunk/PROTO/azy/src/tests/test.azy Modified: trunk/PROTO/azy/src/tests/stress_client.c =================================================================== --- trunk/PROTO/azy/src/tests/stress_client.c 2010-12-01 17:38:42 UTC (rev 55123) +++ trunk/PROTO/azy/src/tests/stress_client.c 2010-12-01 19:41:35 UTC (rev 55124) @@ -32,44 +32,44 @@ return EINA_TRUE; } + +#ifdef HAVE_MYSQL static Eina_Error -_TTest1_getAll_ret(Azy_Client *client __UNUSED__, Azy_Content *content) +_TSQL_test_ret(Azy_Client *client __UNUSED__, Azy_Content *content) { + static int x; - TAllTypes *ret; x++; - // printf("#%i: Success? %s!\n", x, ret ? "YES" : "NO"); if (azy_content_error_is_set(content)) { - printf("%i: Error encountered: %s\n", x, azy_content_error_message_get(content)); + printf("%u: Error encountered: %s\n", azy_content_id_get(content), azy_content_error_message_get(content)); return azy_content_error_code_get(content); } + //printf("#%i: Success? %s!\n", x, azy_content_return_get(content) ? "YES" : "NO"); - ret = azy_content_return_get(content); - -#ifndef HAVE_MYSQL if (x == (NUM_CLIENTS * NUM_CLIENTS)) ecore_main_loop_quit(); -#endif return AZY_ERROR_NONE; } +#else -#ifdef HAVE_MYSQL static Eina_Error -_TSQL_test_ret(Azy_Client *client __UNUSED__, Azy_Content *content) +_TTest1_getAll_ret(Azy_Client *client __UNUSED__, Azy_Content *content) { - static int x; + TAllTypes *ret; x++; if (azy_content_error_is_set(content)) { - printf("%u: Error encountered: %s\n", azy_content_id_get(content), azy_content_error_message_get(content)); + printf("%i: Error encountered: %s\n", x, azy_content_error_message_get(content)); return azy_content_error_code_get(content); } - //printf("#%i: Success? %s!\n", x, azy_content_return_get(content) ? "YES" : "NO"); + ret = azy_content_return_get(content); + // printf("#%i: Success? %s!\n", x, ret ? "YES" : "NO"); + if (x == (NUM_CLIENTS * NUM_CLIENTS)) ecore_main_loop_quit(); return AZY_ERROR_NONE; @@ -98,15 +98,16 @@ Azy_Client_Call_Id ret; if (!azy_client_connected_get(ev)) goto error; - ret = TTest1_getAll(ev, err, NULL); - if (_check_err(err) || (!ret)) - goto error; - azy_client_callback_set(ev, ret, _TTest1_getAll_ret); #ifdef HAVE_MYSQL ret = TSQL_test(ev, err, NULL); if (_check_err(err) || (!ret)) goto error; azy_client_callback_set(ev, ret, _TSQL_test_ret); +#else + ret = TTest1_getAll(ev, err, NULL); + if (_check_err(err) || (!ret)) + goto error; + azy_client_callback_set(ev, ret, _TTest1_getAll_ret); #endif } azy_content_free(err); Modified: trunk/PROTO/azy/src/tests/test.azy =================================================================== --- trunk/PROTO/azy/src/tests/test.azy 2010-12-01 17:38:42 UTC (rev 55123) +++ trunk/PROTO/azy/src/tests/test.azy 2010-12-01 19:41:35 UTC (rev 55124) @@ -1,5 +1,5 @@ /* - * Copyright 2006, 2007 Ondrej Jirman <ond...@zo...> + * Parts copyright 2006, 2007 Ondrej Jirman <ond...@zo...> * Copyright 2010 Mike Blumenkrantz <mi...@ze...> */ |