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

Fix error message because of macro #126

Merged
merged 7 commits into from
May 27, 2021
Merged

Conversation

kdheepak
Copy link
Collaborator

@kdheepak kdheepak commented May 8, 2021

Related to #125

@codecov
Copy link

codecov bot commented May 8, 2021

Codecov Report

Merging #126 (3d067d6) into master (e325c68) will increase coverage by 0.42%.
The diff coverage is 64.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   52.22%   52.64%   +0.42%     
==========================================
  Files           9        9              
  Lines        3839     3850      +11     
==========================================
+ Hits         2005     2027      +22     
+ Misses       1834     1823      -11     
Impacted Files Coverage Δ
src/api.jl 20.86% <37.50%> (+0.10%) ⬆️
src/utils.jl 87.09% <83.33%> (+27.09%) ⬆️
src/helper.jl 44.44% <100.00%> (+1.83%) ⬆️
src/license.jl 72.72% <100.00%> (+1.29%) ⬆️
src/lib.jl 9.94% <0.00%> (+0.46%) ⬆️

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 e325c68...3d067d6. Read the comment docs.

@kdheepak
Copy link
Collaborator Author

kdheepak commented May 8, 2021

Tests pass for me locally.

Screen Shot 2021-05-08 at 11 16 57 AM

However I don't know if this error case is being tested. Does anyone know how to make one of the Lib.XPRS... functions fail consistently so that we can add it as a test?

@kdheepak
Copy link
Collaborator Author

kdheepak commented May 8, 2021

I've added a test that always fails.

    prob = Xpress.XpressProblem()
    @test_throws Xpress.XpressError Xpress.copyprob(prob, prob)

It would be nice to test that the error message string contains 91 Error: No problem has been input but I think this is fine for now. If anyone knows how to do that I can update the test.

src/api.jl Show resolved Hide resolved
@rafabench
Copy link
Collaborator

I've added a test that always fails.

    prob = Xpress.XpressProblem()
    @test_throws Xpress.XpressError Xpress.copyprob(prob, prob)

It would be nice to test that the error message string contains 91 Error: No problem has been input but I think this is fine for now. If anyone knows how to do that I can update the test.

I think this is a way to test this Xpress error.

msg = "Unable to call `Xpress.copyprob`:\n\n91 Error: No problem has been input.\n"
@test_throws Xpress.XpressError(32,msg) Xpress.copyprob(prob, prob)

@kdheepak kdheepak force-pushed the kd/fix-error-message-macro branch from f7fc8fb to 853c57f Compare May 20, 2021 03:07
@kdheepak
Copy link
Collaborator Author

Thanks @rafabench I didn't know about that syntax! I guess I should have read the documentation 😅.

I've updated the PR.

src/api.jl Outdated Show resolved Hide resolved
@joaquimg
Copy link
Member

Good for me!

@joaquimg joaquimg merged commit f15573f into master May 27, 2021
@kdheepak kdheepak deleted the kd/fix-error-message-macro branch May 27, 2021 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants