Commit Graph

94 Commits

Author SHA1 Message Date
Avi Levin dad44a7100 Eo tests: Fix bad free in eo_test_value
When running eo_test_suite we get an memory error: "double free or corruption".
That error arises because we try to free an Eina_Value value in eo_test_value
that doesn't need to freed.
I switched the eina_value_free to wina_value_flush, the proper way of
releasing it.

@fix
2015-01-12 11:56:42 +00:00
Daniel Zaoui bcd7736914 Eo: fix error handling when too many deletions invocations occur.
Before this fix, when a deletion was invoked twice on an object, a
wrong message ("...You wrongly call eo_unref() within a destructor...")
was printed. This was caused by the del_triggered flag that was not
resetted when the destruction finished.

This patch fixes this behavior by printing the right message on a double
deletion.
2014-12-05 03:38:16 +02:00
Stefan Schmidt e42db35528 tests/eo: Do not test for an integer when you get a pointer.
It works but the compiler is right when complaining about it. fail_unless()
expects and integer but we passed in a pointer. Negate the pointer and use
fail_if() like we do in all other places.
2014-11-21 10:20:36 +01:00
Jérémy Zurcher 18ceed4daf Eo: protect against recursive object destruction calls, fixes T1741
Summary:
    Eo: semantic obj->del replaced by obj->destructed
    Eo: protect against recursive object destruction calls
    Eo: add tests for bfada4b

Reviewers: JackDanielZ, tasn

Reviewed By: tasn

Subscribers: cedric

Maniphest Tasks: T1741

Differential Revision: https://phab.enlightenment.org/D1675

Fixes T1741

@fix
2014-11-18 15:25:34 +00:00
Tom Hacohen 805db9c9ed Eo composite objs: Add a test for the recent comp obj fix.
This adds a fragile test for cedric's fix from commit
3550c38080.

It assumes that all the added 64 functions are in order and that each
eo_op chain is 32 in length. As long as those don't change, this should
be a decent test.
2014-10-28 16:19:30 +00:00
Tom Hacohen e1c0928ea3 Eo id: Add regression tests to eo id sanity checks
Relevant commit: 0b86334a85
2014-10-22 11:43:45 +01:00
Tom Hacohen 01a487d881 Eo composite: Fix composite object functions to be eo functions.
For some reason, they were normal functions instead of eo functions,
which makes them harder to bind, less safe, and just wrong.
This commit fixes that.
2014-10-21 12:37:00 +01:00
Tom Hacohen a7560dbc61 Eo: Change eo_add/del/unref behaviour.
Before this change eo_add() used to create an object with 1 ref, and if
the object had a parent, a second ref.
Now, eo_add() always returns an object with 1 ref, and eo_add_ref()
    preserves the old behaviour (for bindings).

eo_unref now un-parents if refcount is 0, and eo_del() is an alias for
eo_unref (will change to be a way to ensure an object is dead and goes
        to zombie-land even if still refed).
2014-09-25 17:38:45 +01:00
Tom Hacohen 6846978ebd Eo: Get rid of eo_add_custom.
We decided to deprecate this one in favour of setting thing in the
construction between the constructor and the finalizer.
2014-09-25 10:30:56 +01:00
Tom Hacohen 2a0937b889 Eo base: Add a property to indicate if the object is finalized;
This enables checking if an object is being created, or has already been
finalized. This is useful in functions that you want to allow
only during the creation phase (i.e inside the eo_add()).
2014-08-29 10:26:23 +01:00
Jérémy Zurcher 46a78e8c9d eo: constructor tests do not use eo_add_custom(..)
as stated in f92e5d50, instead of using eo_add_custom() thus a custom
constructor and maybe overriding the default constructor to block it,

   - use the default constructor to build the object
   - add calls to eo_add(), to initialize the object
     eo_add(class, parent, val_a_set(1), val_b_set(2), ... );
   - override eo_finalize to validate the object and if needed,
     use eo_error_set(obj) to abort object construction
2014-07-03 10:44:15 +02:00
Tom Hacohen 10626ff538 Eo: Fix and use the abstract class .eo file.
Until now it was just there, but never generated or used.
2014-06-03 09:19:19 +01:00
Tom Hacohen d9263e6571 Eo base: rename event_freeze_get to event_freeze_count_get.
This is needed because of a possible clash between the method event_freeze
and the property event_freeze with bindings.
2014-06-02 12:50:23 +01:00
Tom Hacohen f92e5d50f9 Eo: Add eo_finalize. A func that's called at the end of eo_add.
This function lets you hook at the end of eo_add and override it for a
class. This is essentially the first step towards killing custom
constructors. Instead of having a custom constructor, you should just
do:
eo_add(CLASS, parent, a_set(3), b_set("eou"));
eo_constructor is called at the beginning for pre-init things.
eo_finalize is called at the end, for actually finalizing and doing
things. This cleans up the API and possibly saves a lot of things that
would have been stupid and slow in the past, like loading an elm widget
with an existing theme, and then changing the theme.

** This breaks Eo ABI, please recompile elementary and everything else that
creates eo objects.

@feature
2014-05-30 11:22:36 +01:00
Tom Hacohen 75b56c7589 Eo legacy events: Add legacy events tests.
These tests test mixing legacy events with eo events.
2014-05-28 12:28:18 +01:00
Jérémy Zurcher 0b97c11ea2 eo: improve error reporting, update tests 2014-05-08 13:44:47 +02:00
Daniel Zaoui 4de405b42b Eo: Add tests dir to .gitignore 2014-04-22 09:54:24 +03:00
Lukasz Stanislawski 80b1ca8e43 eo: fix broken children iterator, remove redundant fields.
@fix

Summary: Tests added.

Reviewers: raster, JackDanielZ, tasn

CC: cedric

Differential Revision: https://phab.enlightenment.org/D763

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-04-17 19:36:12 +02:00
Tom Hacohen ca6e6c93f5 Eo2: Adjust test suite to recent changes. 2014-04-10 04:20:21 +01:00
Tom Hacohen 3a0d62ffcf Ecore audio tests: Updated to Eo2. 2014-04-10 04:20:21 +01:00
Tom Hacohen 92cc33c46f Eo: EO_BASE_CLASS->EO_CLASS. 2014-04-10 04:20:21 +01:00
Tom Hacohen 374af9b9ca Eo: eo_base's data_*->key_data_*. 2014-04-10 04:20:21 +01:00
Tom Hacohen c32bb4fe95 Eo2: Updated naming Eo2->Eo. 2014-04-10 04:20:21 +01:00
Jérémy Zurcher 4b9c37501c eo2: add tests for thread safe call stack
Summary:
   2 threads run 'eo2_do(o, a(), b());'
   - A goes first, creates an object, enters 'eo2_do(o, a(), b());'
     in a() call, it blocks, releases B and waits for it.
   - B when released, creates an object, enters 'eo2_do(o, a(), b());'
     in a() call, it joins and releases A, then blocks.
   - A returns from a(); and enters b() using current call stack frame,
     which is the one pushed by B! then pop the frame and releases B.
   - B does as above using the stack pushed by A!
2014-04-10 04:20:21 +01:00
Jérémy Zurcher 64aa007caf eo2: update class creation tests, follow new error policy
see previous commit
2014-04-10 04:20:21 +01:00
Jérémy Zurcher 2fb5a54610 eo2: add tests for method call error msgs 2014-04-10 04:20:20 +01:00
Jérémy Zurcher d23b9ffd23 eo2: tests: extract mgs checks into eo_error_msgs.c|h 2014-04-10 04:20:20 +01:00
Jérémy Zurcher 5dc95bb50c eo2: add test cases for class construction errors
it covers: NULL API func, overriding non-existing fct,
API redefined, dich func override.
2014-04-10 04:20:20 +01:00
Jérémy Zurcher 914dde776f eo2: fix uninitialized vars in tests
because of conditional execution of eo2_do() fct calls
these vars could end up not initialized.
2014-04-10 04:20:20 +01:00
Jérémy Zurcher d497459f93 eo2: add tests for call stack grow and shrink 2014-04-10 04:20:20 +01:00
Tom Hacohen 055dd3c521 eo2: change the order of EO2_OP_FUNC* to put EAPI first.
This looks cleaner and more aligned. Also, it makes more sense as the
internal function is bound to the EAPI and not the other way around.
2014-04-10 04:20:20 +01:00
Tom Hacohen ebae305a9e eo2: fixed validity checks for eo2_do_super.
The class should be checked to be valid and non-null.
This fixes the issues with eo_suite.
2014-04-10 04:20:19 +01:00
Tom Hacohen c20c537528 eo2: use EO2_CLASS_DESCRIPTION_NOOPS everywhere. 2014-04-10 04:20:19 +01:00
Tom Hacohen ed14382f7c eo2: fixed a compliation issue in test suite. 2014-04-10 04:20:19 +01:00
Tom Hacohen 7d79b10bb6 eo2 suite: add an important FIXME. 2014-04-10 04:20:19 +01:00
Tom Hacohen 08b28211b6 eo2: migrated the eo-suite test to eo2. 2014-04-10 04:20:19 +01:00
Tom Hacohen 2593cb86c6 eo2: interface test, removed obsolete Eo_Op. 2014-04-10 04:20:19 +01:00
Tom Hacohen f4f62e0f9f eo2: migrated mixin test to eo2. 2014-04-10 04:20:19 +01:00
Tom Hacohen e4f0e4c410 eo2: constructors test, removed obsolete Eo_Op. 2014-04-10 04:20:19 +01:00
Tom Hacohen 13b30abe56 eo2: cleaned up the function overrides test. 2014-04-10 04:20:19 +01:00
Tom Hacohen 3a524e4201 eo2: fix function overrides test. 2014-04-10 04:20:19 +01:00
Jérémy Zurcher b8e9b14699 eo2: fix some op descriptions in constructors tests 2014-04-10 04:20:18 +01:00
Jérémy Zurcher 78973fba6c eo2: fix tests, do not use _CLASS_FUNC_, see previous commit 2014-04-10 04:20:18 +01:00
Tom Hacohen 9a9fdb46fe eo2 test composite: migrated things I forgot to migrate. 2014-04-10 04:20:18 +01:00
Tom Hacohen 18698086b4 eo2: migrated signals test to eo2. 2014-04-10 04:20:18 +01:00
Tom Hacohen 760a74a150 eo2: migrated interface test to eo2. 2014-04-10 04:20:18 +01:00
Tom Hacohen 0ee8b33bf7 eo2: migrated function_overrides test to eo2. 2014-04-10 04:20:18 +01:00
Tom Hacohen cbc9a7bd30 eo2: migrated constructors test to eo2. 2014-04-10 04:20:18 +01:00
Tom Hacohen e5c7d666e0 eo2: migrated the composite test to eo2. 2014-04-10 04:20:18 +01:00
Tom Hacohen 7c0598c930 eo2: access tests makeup 2014-04-10 04:20:18 +01:00