diff options
author | Eduardo Lima (Etrunko) <eduardo.lima@intel.com> | 2013-09-17 15:33:38 -0300 |
---|---|---|
committer | Eduardo Lima (Etrunko) <eduardo.lima@intel.com> | 2013-09-19 19:45:26 -0300 |
commit | 46543660eb478de9b20becdd6f7de09748538b36 (patch) | |
tree | 02319732eedce86f1be92163902196ae1247c469 /src | |
parent | 0a7ee257c2c3fd8e9db4b311b3cf7cb41385a1ac (diff) | |
download | weekeyboard-46543660eb478de9b20becdd6f7de09748538b36.tar.gz weekeyboard-46543660eb478de9b20becdd6f7de09748538b36.tar.bz2 weekeyboard-46543660eb478de9b20becdd6f7de09748538b36.zip |
Fix initializations in tests
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/wkb-ibus-config-eet-test.c | 10 | ||||
-rw-r--r-- | src/wkb-ibus-test.c | 27 |
2 files changed, 30 insertions, 7 deletions
diff --git a/src/wkb-ibus-config-eet-test.c b/src/wkb-ibus-config-eet-test.c index a4f0ced..5c014f1 100644 --- a/src/wkb-ibus-config-eet-test.c +++ b/src/wkb-ibus-config-eet-test.c @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include "wkb-ibus-config-eet.h" +#include <stdio.h> #include <Eina.h> #include <Eet.h> +#include "wkb-ibus-config-eet.h" + int main (int argc, char *argv[]) { @@ -33,13 +34,16 @@ main (int argc, char *argv[]) if (!eet_init()) { printf("Error initializing eet"); - return 1; + goto eet_err; } cfg = wkb_ibus_config_eet_new("ibus-cfg.eet"); wkb_ibus_config_eet_free(cfg); +end: eet_shutdown(); + +eet_err: eina_shutdown(); return 0; diff --git a/src/wkb-ibus-test.c b/src/wkb-ibus-test.c index ced4700..e9bcf03 100644 --- a/src/wkb-ibus-test.c +++ b/src/wkb-ibus-test.c @@ -19,6 +19,8 @@ #define _GNU_SOURCE #include <signal.h> +#include <Eina.h> +#include <Eet.h> #include <Ecore.h> #include <Eldbus.h> @@ -38,22 +40,32 @@ _connect_timer(void *data) int main (int argc, char *argv[]) { + int ret = 0; + if (!eet_init()) + { + printf("Error initializing eet"); + return 1; + } + if (!ecore_init()) { printf("Error initializing ecore"); - return 1; + ret = 1; + goto ecore_err; } if (!eldbus_init()) { printf("Error initializing eldbus"); - return 1; + ret = 1; + goto eldbus_err; } if (!wkb_ibus_init()) { printf("Error initializing ibus"); - return 1; + ret = 1; + goto end; } ecore_timer_add(1, _connect_timer, NULL); @@ -63,7 +75,14 @@ main (int argc, char *argv[]) ecore_main_loop_begin(); +end: eldbus_shutdown(); + +eldbus_err: ecore_shutdown(); - return 0; + +ecore_err: + eet_shutdown(); + + return ret; } |