summaryrefslogtreecommitdiff
path: root/src/tests/eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-18 15:09:27 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-21 08:56:13 +0100
commit5284ac36ca090a0870079a59fd9867c47fc9343c (patch)
treeaf2889504d75d9458302bdb48b277ddec9cad18b /src/tests/eo
parenta152ba6d5b7ed1a8d4c111e2b7d7025a733818a9 (diff)
eo: add API for querying the class type
a class can be a interface mixin abstract or regular. This adds a API for getting this information
Diffstat (limited to 'src/tests/eo')
-rw-r--r--src/tests/eo/interface/interface_main.c2
-rw-r--r--src/tests/eo/mixin/mixin_main.c3
-rw-r--r--src/tests/eo/suite/eo_test_general.c8
3 files changed, 13 insertions, 0 deletions
diff --git a/src/tests/eo/interface/interface_main.c b/src/tests/eo/interface/interface_main.c
index ed56c9fa26..48685bb047 100644
--- a/src/tests/eo/interface/interface_main.c
+++ b/src/tests/eo/interface/interface_main.c
@@ -41,6 +41,8 @@ main(int argc, char *argv[])
41 fail_if(!efl_isa(SIMPLE_CLASS, INTERFACE2_CLASS)); 41 fail_if(!efl_isa(SIMPLE_CLASS, INTERFACE2_CLASS));
42 fail_if(efl_isa(INTERFACE_CLASS, INTERFACE2_CLASS)); 42 fail_if(efl_isa(INTERFACE_CLASS, INTERFACE2_CLASS));
43 43
44 fail_if(efl_class_type_get(INTERFACE_CLASS) != EFL_CLASS_TYPE_INTERFACE);
45
44 efl_unref(obj); 46 efl_unref(obj);
45 efl_object_shutdown(); 47 efl_object_shutdown();
46 return 0; 48 return 0;
diff --git a/src/tests/eo/mixin/mixin_main.c b/src/tests/eo/mixin/mixin_main.c
index 2ef7b360a4..3b8a022f2b 100644
--- a/src/tests/eo/mixin/mixin_main.c
+++ b/src/tests/eo/mixin/mixin_main.c
@@ -46,6 +46,9 @@ main(int argc, char *argv[])
46 printf("%d\n", a); 46 printf("%d\n", a);
47 fail_if(a != 5); 47 fail_if(a != 5);
48 48
49 fail_if(efl_class_type_get(MIXIN_CLASS) != EFL_CLASS_TYPE_MIXIN);
50
51
49 efl_unref(obj); 52 efl_unref(obj);
50 efl_object_shutdown(); 53 efl_object_shutdown();
51 return 0; 54 return 0;
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index c483fc45be..1494f46c95 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -1841,6 +1841,13 @@ EFL_START_TEST(eo_test_class_replacement)
1841} 1841}
1842EFL_END_TEST 1842EFL_END_TEST
1843 1843
1844EFL_START_TEST(eo_test_class_type)
1845{
1846 ck_assert_int_eq(efl_class_type_get(SIMPLE_CLASS), EFL_CLASS_TYPE_REGULAR);
1847 ck_assert_int_eq(efl_class_type_get((void*)0xAFFE), EFL_CLASS_TYPE_INVALID);
1848}
1849EFL_END_TEST
1850
1844void eo_test_general(TCase *tc) 1851void eo_test_general(TCase *tc)
1845{ 1852{
1846 tcase_add_test(tc, eo_simple); 1853 tcase_add_test(tc, eo_simple);
@@ -1870,4 +1877,5 @@ void eo_test_general(TCase *tc)
1870 tcase_add_test(tc, efl_object_destruct_test); 1877 tcase_add_test(tc, efl_object_destruct_test);
1871 tcase_add_test(tc, efl_object_auto_unref_test); 1878 tcase_add_test(tc, efl_object_auto_unref_test);
1872 tcase_add_test(tc, efl_object_size); 1879 tcase_add_test(tc, efl_object_size);
1880 tcase_add_test(tc, eo_test_class_type);
1873} 1881}