From 59a132264f72d2085e32cfa1dbb717091bb953c4 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 6 May 2012 14:18:44 +0000 Subject: [PATCH] Eo: Test getting data from class with no data. SVN revision: 70816 --- legacy/eobj/tests/eo_test_general.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/legacy/eobj/tests/eo_test_general.c b/legacy/eobj/tests/eo_test_general.c index eae168c8e9..9f3fc21c9b 100644 --- a/legacy/eobj/tests/eo_test_general.c +++ b/legacy/eobj/tests/eo_test_general.c @@ -23,7 +23,8 @@ START_TEST(eo_data_fetch) { eo_init(); - static const Eo_Class_Description class_desc = { + /* Usually should be const, not const only for the test... */ + static Eo_Class_Description class_desc = { "Simple2", EO_CLASS_TYPE_REGULAR, EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0), @@ -45,6 +46,15 @@ START_TEST(eo_data_fetch) #endif eo_unref(obj); + class_desc.data_size = 0; + klass = eo_class_new(&class_desc, EO_BASE_CLASS, NULL); + fail_if(!klass); + + obj = eo_add(klass, NULL); + fail_if(!obj); + fail_if(eo_data_get(obj, klass)); + eo_unref(obj); + eo_shutdown(); } END_TEST