Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interface-wide default calling convention #87

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add interface-wide default calling convention #87

wants to merge 7 commits into from

Conversation

sunkin351
Copy link
Contributor

NativeSymbolsAttribute updated to have a specifiable interface-wide calling convention, along with internal logic to accommodate.

@codecov
Copy link

codecov bot commented Jul 1, 2019

Codecov Report

Merging #87 into master will decrease coverage by 0.09%.
The diff coverage is 61.11%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #87     +/-   ##
=========================================
- Coverage   89.44%   89.35%   -0.1%     
=========================================
  Files         114      114             
  Lines        5516     5532     +16     
  Branches      456      461      +5     
=========================================
+ Hits         4934     4943      +9     
- Misses        576      583      +7     
  Partials        6        6
Impacted Files Coverage Δ
...ransformation/Attributes/NativeSymbolsAttribute.cs 44.44% <ø> (ø) ⬆️
...cedDLSupport/Reflection/IntrospectiveMemberBase.cs 75% <61.11%> (-4.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ab2c03...e238fce. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 1, 2019

Codecov Report

Merging #87 into master will decrease coverage by 2.26%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
- Coverage   89.09%   86.83%   -2.27%     
==========================================
  Files         115      116       +1     
  Lines        5642     5584      -58     
  Branches      497      463      -34     
==========================================
- Hits         5027     4849     -178     
- Misses        604      717     +113     
- Partials       11       18       +7
Impacted Files Coverage Δ
...ancedDLSupport/Attributes/NativeSymbolAttribute.cs 100% <ø> (ø) ⬆️
...ransformation/Attributes/NativeSymbolsAttribute.cs 44.44% <ø> (ø) ⬆️
...cedDLSupport/Reflection/IntrospectiveMemberBase.cs 80% <100%> (-0.56%) ⬇️
....Tests/Tests/Integration/CallingConventionTests.cs 100% <100%> (ø)
AdvancedDLSupport/Loaders/LinuxPlatformLoader.cs 0% <0%> (-100%) ⬇️
AdvancedDLSupport/Loaders/BSDPlatformLoader.cs 0% <0%> (-100%) ⬇️
AdvancedDLSupport/Loaders/Native/dl.cs 5.88% <0%> (-82.36%) ⬇️
AdvancedDLSupport/Loaders/UnixPlatformLoader.cs 10.81% <0%> (-78.38%) ⬇️
...vancedDLSupport/PathResolvers/MacOSPathResolver.cs 16.66% <0%> (-58.34%) ⬇️
...vancedDLSupport/PathResolvers/LinuxPathResolver.cs 20% <0%> (-42.86%) ⬇️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd003ff...df98ed7. Read the comment docs.

@Nihlus
Copy link
Owner

Nihlus commented Jul 2, 2019

So based on some of the discussions on github, here's an outline of the test cases that need to be implemented:

Case 1

  • Interface only
  • Single method without explicit calling convention
  • Calling convention set in NativeSymbols attribute on the interface

Expected Results

Method uses the calling convention from the NativeSymbols attribute and can be successfully called.

Case 2

  • Interface only
  • Two methods
    • Method one does not have an explicit calling convention set
    • Method two has an explicit calling convention set via a NativeSymbol attribute

Expected Results

Method one uses the calling convention from the NativeSymbols attribute. Method two uses the calling convention set in its specific NativeSymbol attribute.

Case 3

  • Mixed-mode class
  • Multiple interface implementation
  • Interface one has a NativeSymbols attribute
  • Interface two does not

Expected Results

Methods from interface one uses the calling convention from the NativeSymbols attribute on their interface. Methods from interface two does not.

Case 4

  • Mixed-mode class
  • Multiple interface implementation
  • Interface one has a NativeSymbols attribute
  • Interface two has a NativeSymbols attribute with a different calling convention.

Expected Results

Methods from interface one uses the calling convention from the NativeSymbols attribute on their interface. Methods from interface two uses the calling convention from the NativeSymbols attribute on their interface.

@Nihlus
Copy link
Owner

Nihlus commented Sep 21, 2019

Can you rebase this on master and ensure the tests pass before I review it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants