Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
a4ed3eae
Unverified
Commit
a4ed3eae
authored
Jun 22, 2021
by
Miroslav Kratochvil
Committed by
GitHub
Jun 22, 2021
Browse files
Merge pull request #73 from giordano/mg/get_string
Strip whitespaces when reporting error messages from `readSBML`
parents
1721265b
3da6281d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/readsbml.jl
View file @
a4ed3eae
...
...
@@ -99,8 +99,8 @@ function readSBML(fn::String, sbml_conversion = document -> nothing)::SBML.Model
n_errs
=
ccall
(
sbml
(
:
SBMLDocument_getNumErrors
),
Cuint
,
(
VPtr
,),
doc
)
for
i
=
0
:
n_errs
-
1
err
=
ccall
(
sbml
(
:
SBMLDocument_getError
),
VPtr
,
(
VPtr
,
Cuint
),
doc
,
i
)
msg
=
get_string
(
err
,
:
XMLError_getMessage
)
@
warn
"SBML reported error:
$
msg"
msg
=
strip
(
get_string
(
err
,
:
XMLError_getMessage
)
)
@
error
"SBML reported error:
$
msg"
end
if
n_errs
>
0
throw
(
AssertionError
(
"Opening SBML document has reported errors"
))
...
...
test/ecoli_flux.jl
View file @
a4ed3eae
...
...
@@ -18,8 +18,7 @@ end
@test
typeof
(
mdl
)
==
Model
@info
"The next warning is an expected side-effect of testing an error condition"
@test_throws
AssertionError
readSBML
(
sbmlfile
*
".does.not.really.exist"
)
@test_logs
(
:
error
,
"SBML reported error: File unreadable."
)
@test_throws
AssertionError
readSBML
(
sbmlfile
*
".does.not.really.exist"
)
@test
length
(
mdl
.
compartments
)
==
2
...
...
cylon-x
🤖
@cylon-x
mentioned in commit
852bb75a
·
Jun 22, 2021
mentioned in commit
852bb75a
mentioned in commit 852bb75ae7a1a17778b5ee64683b820ed1ef5540
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment