aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/tests/eina_test_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/eina/src/tests/eina_test_error.c')
-rw-r--r--libraries/eina/src/tests/eina_test_error.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/libraries/eina/src/tests/eina_test_error.c b/libraries/eina/src/tests/eina_test_error.c
new file mode 100644
index 0000000..506f406
--- /dev/null
+++ b/libraries/eina/src/tests/eina_test_error.c
@@ -0,0 +1,59 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric Bail
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifdef HAVE_CONFIG_H
20# include "config.h"
21#endif
22
23#include <stdlib.h>
24#include <stdio.h>
25#include <string.h>
26
27#ifdef HAVE_EVIL
28# include <Evil.h>
29#endif
30
31#include "eina_suite.h"
32#include "Eina.h"
33
34#define TEST_TEXT "The big test\n"
35
36START_TEST(eina_error_errno)
37{
38 int test;
39
40 setenv("EINA_ERROR_LEVEL", "1", 0);
41
42 eina_init();
43
44 test = eina_error_msg_register(TEST_TEXT);
45 fail_if(!eina_error_msg_get(test));
46 fail_if(strcmp(eina_error_msg_get(test), TEST_TEXT) != 0);
47
48 eina_error_set(test);
49 fail_if(eina_error_get() != test);
50
51 eina_shutdown();
52}
53END_TEST
54
55void
56eina_test_error(TCase *tc)
57{
58 tcase_add_test(tc, eina_error_errno);
59}