Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
go-daq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
MIM
go-daq
Commits
4a5464e3
Commit
4a5464e3
authored
5 years ago
by
Sebastien Binet
Browse files
Options
Downloads
Patches
Plain Diff
dif: more Readout test coverage
parent
d0b786e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dif/readout_test.go
+14
-0
14 additions, 0 deletions
dif/readout_test.go
with
14 additions
and
0 deletions
dif/readout_test.go
+
14
−
0
View file @
4a5464e3
...
@@ -12,6 +12,7 @@ import (
...
@@ -12,6 +12,7 @@ import (
"github.com/go-daq/tdaq/log"
"github.com/go-daq/tdaq/log"
"github.com/ziutek/ftdi"
"github.com/ziutek/ftdi"
"golang.org/x/xerrors"
)
)
func
ftdiOpenTest
(
vid
,
pid
uint16
)
(
ftdiDevice
,
error
)
{
func
ftdiOpenTest
(
vid
,
pid
uint16
)
(
ftdiDevice
,
error
)
{
...
@@ -24,6 +25,19 @@ func TestReadout(t *testing.T) {
...
@@ -24,6 +25,19 @@ func TestReadout(t *testing.T) {
ftdiOpen
=
ftdiOpenImpl
ftdiOpen
=
ftdiOpenImpl
}()
}()
{
const
name
=
"FT101xxx"
rdo
,
err
:=
NewReadout
(
name
,
0x6014
,
nil
)
if
err
==
nil
{
rdo
.
close
()
t
.
Fatalf
(
"expected an error"
)
}
want
:=
xerrors
.
Errorf
(
"could not find DIF-id from %q: %s"
,
name
,
xerrors
.
New
(
"expected integer"
))
if
got
,
want
:=
err
.
Error
(),
want
.
Error
();
got
!=
want
{
t
.
Fatalf
(
"invalid error:
\n
got= %v
\n
want=%v"
,
got
,
want
)
}
}
const
(
const
(
name
=
"FT101042"
name
=
"FT101042"
prodID
=
0x6014
prodID
=
0x6014
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment