Page MenuHomePhabricator

efl_mono: Use architecture independent ECANCELED
Needs ReviewPublic

Authored by lucas on Sep 21 2020, 9:49 AM.

Details

Reviewers
felipealmeida
Summary

efl_mono was assuming ECANCELED as in Linux, which made some tests
fail.

test_simple_futere_cancel and test_cancel_after_resolve checks if
the returned error code is ECANCELED but Eina.Error.ECANCELED was
base on Linux ECANCELED which is diferent from OSX causing:

[ ERROR       ] AssertionException: /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:138 (test_simple_future_cancel) Left hand side "Eina.Error(89)", right hand side "Eina.Error(125)"
at Test.AssertEquals[T](T lhs, T rhs, String msg, Int32 line, String file, String member) in /Users/lucas/expertise/efl1/src/tests/efl_mono/TestUtils.cs:line 73
at TestSuite.TestPromises.test_simple_future_cancel() in /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:line 138
[        FAIL ] TestPromises.test_simple_future_cancel
[ ERROR       ] AssertionException: /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:256 (test_cancel_after_resolve) Left hand side "Eina.Error(89)", right hand side "Eina.Error(125)"
at Test.AssertEquals[T](T lhs, T rhs, String msg, Int32 line, String file, String member) in /Users/lucas/expertise/efl1/src/tests/efl_mono/TestUtils.cs:line 73
at TestSuite.TestPromises.test_cancel_after_resolve() in /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:line 256
[        FAIL ] TestPromises.test_cancel_after_resolve

And iwraper.cs:WrapAssync was only considering Linux ECANCELED thus causing
a rise of an Efl.FutureException: Future failed instead of the expected
TaskCanceledException making fail at TestEoAsyncMethods.test_async_cancel:

[ RUN         ] TestEoAsyncMethods.test_async_cancel
[ ERROR       ] AssertionException: Assertion failed: /Users/lucas/expertise/efl1/src/tests/efl_mono/EoPromises.cs:175 (test_async_cancel) AggregateException must have been TaskCanceledException
   at Test.Assert(Boolean res, String msg, Int32 line, String file, String member) in /Users/lucas/expertise/efl1/src/tests/efl_mono/TestUtils.cs:line 53
   at TestSuite.TestEoAsyncMethods.<>c.<test_async_cancel>b__1_0(Exception x) in /Users/lucas/expertise/efl1/src/tests/efl_mono/EoPromises.cs:line 175
   at System.AggregateException.Handle(Func`2 predicate)
   at TestSuite.TestEoAsyncMethods.test_async_cancel() in /Users/lucas/expertise/efl1/src/tests/efl_mono/EoPromises.cs:line 171
[        FAIL ] TestEoAsyncMethods.test_async_cancel

Depends on D12156

Test Plan

Compare with master and note that with this diff all tests pass.

  • Configure as especified by Enlightenment man page + -Dbindigns=mono -Ddotnet=true:
meson -Dsystemd=false -Dv4l2=false -Davahi=false -Deeze=false -Dx11=false -Dopengl=full -Dcocoa=true -Dnls=false -Demotion-loaders-disabler=gstreamer1,libvlc,xine -Decore-imf-loaders-disabler=scim,ibus -Dbindigns=cxx,mono -Ddotnet=true build
  • Build normally
  • Test efl-mono-suite

Diff Detail

Repository
rEFL core/efl
Branch
arcpatch-D12157
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17376
Build 11638: arc lint + arc unit
lucas created this revision.Sep 21 2020, 9:49 AM
lucas requested review of this revision.Sep 21 2020, 9:49 AM

Hello @lucas, can you fix for Windows too? The code is 105 in Windows.

lucas updated this revision to Diff 31195.Mon, Oct 5, 2:02 PM

Adds ECANCELED for Windows (code 150)

lucas updated this revision to Diff 31196.Mon, Oct 5, 2:08 PM

Correct ECANCELED code for Windows

It, actually, is 105.

Correct ECANCELED code for Windows

It, actually, is 105.

Please update the comment as well.

/// Returns 125 for Linux and 89 for OSX
lucas updated this revision to Diff 31213.Tue, Oct 13, 5:03 AM

Update summary description

lucas added a comment.Tue, Oct 13, 5:05 AM

Correct ECANCELED code for Windows

It, actually, is 105.

Please update the comment as well.

/// Returns 125 for Linux and 89 for OSX

Thanks, @ProhtMeyhet.