Page MenuHomePhabricator

csharp: Fix test code memory handling
ClosedPublic

Authored by lauromoura on Apr 22 2019, 2:43 PM.

Details

Summary

It was causing the test to crash when running in debug build.

Also some minor fixes cleaning up stuff when exiting.

Fixes T7792.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lauromoura created this revision.Apr 22 2019, 2:43 PM
lauromoura requested review of this revision.Apr 22 2019, 2:43 PM

The failure occurred because the Dummy.TestObject.set_value implementation either freed the stored value or created the new one. This worked normally outside of debug mode probably due to mempool reusing the memory address. The debug build uses the pass-through mempool, making the problem appear.

lauromoura planned changes to this revision.Apr 22 2019, 2:52 PM
lauromoura added inline comments.
src/tests/efl_mono/libefl_mono_native_test.c
154

Eo initializes the object data to zero. Will remove these initializations.

lauromoura updated this revision to Diff 21541.Apr 22 2019, 3:01 PM

Removed uneeded initializations

lauromoura marked an inline comment as done.Apr 22 2019, 3:10 PM
segfaultxavi accepted this revision.Apr 23 2019, 4:23 AM

Makes sense and fixes the test!

This revision is now accepted and ready to land.Apr 23 2019, 4:23 AM
vitor.sousa accepted this revision.Apr 23 2019, 8:11 AM
This revision was automatically updated to reflect the committed changes.