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

Changed conversion, added tests #145

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

sebasguts
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Nov 7, 2018

Codecov Report

Merging #145 into master will increase coverage by 0.41%.
The diff coverage is 90.9%.

@@            Coverage Diff            @@
##           master    #145      +/-   ##
=========================================
+ Coverage   55.99%   56.4%   +0.41%     
=========================================
  Files          44      44              
  Lines        2611    2599      -12     
=========================================
+ Hits         1462    1466       +4     
+ Misses       1149    1133      -16
Impacted Files Coverage Δ
LibGAP.jl/src/ccalls.jl 85.71% <100%> (ø) ⬆️
LibGAP.jl/src/gap.jl 84.21% <100%> (ø) ⬆️
LibGAP.jl/src/conversion.jl 94.44% <88.88%> (+51.11%) ⬆️

@sebasguts sebasguts changed the title WIP: Changed conversion, added tests Changed conversion, added tests Nov 7, 2018
@sebasguts sebasguts requested a review from fingolfin November 7, 2018 16:56
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly this is an improvement.

But I worry about the fact that we are implementing separate conversions in the GAP / C side and the Julia side; not only does this duplicate a lot of work, it also means that the two are not behaving the same.

We should think about a way that allows us to implement all these conversions once (either in C or Julia; can be mixed, depending on the situation, too); and then share these implementations between LibGAP.jl and JuliaInterface.

That's not for this PR, though, but rather something I'll put into an issue.

from_gap_string(obj :: MPtr) = CSTR_STRING(obj)
from_gap_symbol(obj :: MPtr) = Symbol(from_gap_string(obj))
from_gap(obj , ::Any) = obj
from_gap(obj :: MPtr, ::Type{AbstractString}) = CSTR_STRING(obj)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the comment above, this (still) does not perform any input validation and will crash or produce garbage if called on a non-string GAP object. Something to fix in a future PR, I guess.

@sebasguts
Copy link
Contributor Author

Agreed. I will provide a PR which uses the C functions instead.

@sebasguts sebasguts merged commit bc15b44 into oscar-system:master Nov 8, 2018
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