diff options
author | tasn <tasn> | 2012-08-23 10:35:14 +0000 |
---|---|---|
committer | tasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33> | 2012-08-23 10:35:14 +0000 |
commit | a129099d48dc4f0c4fe7f1993b2218439dc1c15e (patch) | |
tree | 0a759310af7b9b73e55971bd16ff94c2ef8ee28f /src/tests/eo_suite/eo_test_general.c | |
parent | 7f6793869bc753e3846b53350525cea04ca55145 (diff) | |
download | eobj-a129099d48dc4f0c4fe7f1993b2218439dc1c15e.tar.gz eobj-a129099d48dc4f0c4fe7f1993b2218439dc1c15e.tar.bz2 eobj-a129099d48dc4f0c4fe7f1993b2218439dc1c15e.zip |
Eo: Added eo_add_custom and support for passing ops to eo_add.
We can no do things like eo_add(CLASS, parent, age_set(7), score_set(100)),
or pass different constructors to object creation by using eo_add_custom and
passing the constructor.
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@75614 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
Diffstat (limited to 'src/tests/eo_suite/eo_test_general.c')
-rw-r--r-- | src/tests/eo_suite/eo_test_general.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/eo_suite/eo_test_general.c b/src/tests/eo_suite/eo_test_general.c index ac395d2..20ab4b5 100644 --- a/src/tests/eo_suite/eo_test_general.c +++ b/src/tests/eo_suite/eo_test_general.c @@ -695,6 +695,32 @@ START_TEST(eo_multiple_do) } END_TEST +START_TEST(eo_add_do_and_custom) +{ + Simple_Public_Data *pd = NULL; + Eo *obj = NULL; + eo_init(); + + obj = eo_add_custom(SIMPLE_CLASS, NULL, eo_constructor()); + fail_if(!obj); + eo_unref(obj); + + obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(7)); + fail_if(!obj); + pd = eo_data_get(obj, SIMPLE_CLASS); + fail_if(pd->a != 7); + eo_unref(obj); + + obj = eo_add_custom(SIMPLE_CLASS, NULL, eo_constructor(), simple_a_set(7)); + fail_if(!obj); + pd = eo_data_get(obj, SIMPLE_CLASS); + fail_if(pd->a != 7); + eo_unref(obj); + + eo_shutdown(); +} +END_TEST + void eo_test_general(TCase *tc) { tcase_add_test(tc, eo_generic_data); @@ -708,4 +734,5 @@ void eo_test_general(TCase *tc) tcase_add_test(tc, eo_composite_tests); tcase_add_test(tc, eo_isa_tests); tcase_add_test(tc, eo_multiple_do); + tcase_add_test(tc, eo_add_do_and_custom); } |