2012-05-01 00:40:14 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-02-04 06:02:57 -08:00
|
|
|
#include <Eo.h>
|
2012-05-01 00:40:14 -07:00
|
|
|
|
2012-09-07 14:56:44 -07:00
|
|
|
#include "eo_suite.h"
|
2016-04-06 02:16:24 -07:00
|
|
|
#include "eo_test_class_simple.h"
|
2012-05-01 00:40:14 -07:00
|
|
|
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_START_TEST(eo_test_simple)
|
2012-05-01 00:40:14 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
fail_if(!efl_object_init()); /* one init by test suite */
|
|
|
|
fail_if(!efl_object_shutdown());
|
2012-05-01 00:40:14 -07:00
|
|
|
}
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_END_TEST
|
2012-05-01 00:40:14 -07:00
|
|
|
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_START_TEST(eo_test_init_shutdown)
|
2016-02-03 08:52:25 -08:00
|
|
|
{
|
2016-04-06 02:16:24 -07:00
|
|
|
Eo *obj;
|
|
|
|
|
2016-12-07 05:18:41 -08:00
|
|
|
ck_assert_str_eq("Efl.Object", efl_class_name_get(EFL_OBJECT_CLASS));
|
2016-04-06 02:16:24 -07:00
|
|
|
|
|
|
|
/* XXX-1: Essential for the next test to assign the wrong op. */
|
2018-03-15 09:50:20 -07:00
|
|
|
obj = efl_add_ref(SIMPLE_CLASS, NULL);
|
2016-04-06 02:16:24 -07:00
|
|
|
simple_a_set(obj, 1);
|
2019-02-10 07:57:00 -08:00
|
|
|
/* XXX-1: Essential for the next test to cache the op. */
|
2016-04-06 02:16:24 -07:00
|
|
|
ck_assert_int_eq(1, simple_a_get(obj));
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_unref(obj);
|
|
|
|
fail_if(efl_object_shutdown());
|
2016-02-03 08:52:25 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
fail_if(!efl_object_init());
|
2016-12-07 05:18:41 -08:00
|
|
|
ck_assert_str_eq("Efl.Object", efl_class_name_get(EFL_OBJECT_CLASS));
|
2016-04-06 02:16:24 -07:00
|
|
|
|
|
|
|
/* XXX-1: Verify that the op was not cached. */
|
2019-02-10 07:57:00 -08:00
|
|
|
obj = efl_add_ref(SIMPLE_CLASS, NULL);
|
|
|
|
simple_a_set(obj, 1);
|
|
|
|
ck_assert_int_eq(1, simple_a_get(obj));
|
2016-02-03 08:52:25 -08:00
|
|
|
}
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_END_TEST
|
2016-02-03 08:52:25 -08:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
void eo_test_init(TCase *tc)
|
|
|
|
{
|
2016-02-04 06:02:57 -08:00
|
|
|
tcase_add_test(tc, eo_test_simple);
|
|
|
|
tcase_add_test(tc, eo_test_init_shutdown);
|
2012-05-01 00:40:14 -07:00
|
|
|
}
|