Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mattias Fält
moberg
Commits
cb0a1d50
Commit
cb0a1d50
authored
Mar 29, 2019
by
Anders Blomdell
Browse files
Add cleanup in test case
parent
88aa7def
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_io.c
View file @
cb0a1d50
...
...
@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
}
if
(
!
moberg_OK
(
ai0
.
read
(
ai0
.
context
,
&
ai0_value
)))
{
fprintf
(
stderr
,
"READ failed
\n
"
);
goto
close
;
goto
close
_ai0
;
}
fprintf
(
stderr
,
"READ ai0: %f
\n
"
,
ai0_value
);
if
(
!
moberg_OK
(
moberg_analog_out_open
(
moberg
,
0
,
&
ao0
)))
{
...
...
@@ -26,13 +26,15 @@ int main(int argc, char *argv[])
}
if
(
!
moberg_OK
(
ao0
.
write
(
ao0
.
context
,
ai0_value
*
2
)))
{
fprintf
(
stderr
,
"READ failed
\n
"
);
goto
close
;
goto
close
_ao0
;
}
fprintf
(
stderr
,
"WROTE ao0: %f
\n
"
,
ai0_value
*
2
);
close:
close_ao0:
moberg_analog_out_close
(
moberg
,
0
,
ao0
);
close_ai0:
moberg_analog_in_close
(
moberg
,
0
,
ai0
);
free:
free:
moberg_free
(
moberg
);
out:
out:
return
0
;
}
Write
Preview
Supports
Markdown
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