Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha - Software
Commits
5cd74245
Commit
5cd74245
authored
May 19, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py: fix flush and test it
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
2948417d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
PyFmcFineDelay.py
lib/PyFmcFineDelay/PyFmcFineDelay/PyFmcFineDelay.py
+1
-2
test_fmcfd_loop.py
pytest/test-01-functionalities/test_fmcfd_loop.py
+9
-0
No files found.
lib/PyFmcFineDelay/PyFmcFineDelay/PyFmcFineDelay.py
View file @
5cd74245
...
...
@@ -462,8 +462,7 @@ class FmcFineDelay(object):
def
flush
(
self
):
while
True
:
try
:
ret
=
self
.
read
(
10
,
os
.
O_NONBLOCK
)
if
ret
==
0
:
if
len
(
self
.
read
(
1024
,
os
.
O_NONBLOCK
))
==
0
:
break
except
OSError
:
break
...
...
pytest/test-01-functionalities/test_fmcfd_loop.py
View file @
5cd74245
...
...
@@ -48,6 +48,15 @@ class TestFmcfdLoop(object):
chan 4 o-------`
"""
def
test_output_flush
(
self
,
fmcfd
,
fmcfd_chan
,
fmcfd_tdc
):
poll
=
select
.
poll
()
poll
.
register
(
fmcfd_tdc
.
fileno
,
select
.
POLLIN
)
fmcfd_chan
.
pulse_generate
(
fmcfd
.
time
+
FmcFineDelayTime
(
2
,
0
,
0
),
200000
,
400000
,
16
)
assert
len
(
poll
.
poll
(
4000
))
>
0
fmcfd_tdc
.
flush
()
assert
len
(
poll
.
poll
(
4000
))
==
0
@
pytest
.
mark
.
parametrize
(
"count"
,
[
1
,
2
,
3
,
5
,
7
,
10
,
100
,
1000
,
10000
,
65535
])
def
test_output_counter
(
self
,
fmcfd
,
fmcfd_chan
,
fmcfd_tdc
,
count
):
...
...
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