aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/eo/suite/eo_test_general.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eo/suite/eo_test_general.c')
-rw-r--r--src/tests/eo/suite/eo_test_general.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index baef2fe569..91ecd1c4c8 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -937,6 +937,39 @@ START_TEST(eo_add_failures)
}
END_TEST
+START_TEST(eo_parts)
+{
+ int a = 0;
+
+ eo_init();
+
+ Eo *obj = eo_add(SIMPLE_CLASS, NULL);
+
+ eo_do(obj, simple_a_set(3), a = simple_a_get());
+ ck_assert_int_eq(a, 3);
+
+ eo_do_part(obj, simple_part_get("test"),
+ simple_a_set(7),
+ a = simple_a_get()
+ );
+ ck_assert_int_eq(a, 7);
+
+ eo_do(obj, simple_a_set(3), a = simple_a_get());
+ ck_assert_int_eq(a, 3);
+
+ /* Faking a call, just asserting NULL as the part to check default values. */
+ eo_do_part(obj, NULL,
+ simple_a_set(7),
+ a = simple_a_get()
+ );
+ ck_assert_int_eq(a, 0);
+
+ eo_del(obj);
+
+ eo_shutdown();
+}
+END_TEST
+
void eo_test_general(TCase *tc)
{
tcase_add_test(tc, eo_simple);
@@ -954,4 +987,5 @@ void eo_test_general(TCase *tc)
tcase_add_test(tc, eo_add_do_and_custom);
tcase_add_test(tc, eo_pointers_indirection);
tcase_add_test(tc, eo_add_failures);
+ tcase_add_test(tc, eo_parts);
}