Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
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
White Rabbit Trigger Distribution
Commits
4c034667
Commit
4c034667
authored
Sep 04, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ut: fix test_msg_time test.
parent
cf73fa96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
wrtd-ut-input.c
software/unittest/wrtd-ut-input.c
+1
-1
wrtd-ut-op.c
software/unittest/wrtd-ut-op.c
+10
-11
No files found.
software/unittest/wrtd-ut-input.c
View file @
4c034667
...
...
@@ -175,7 +175,7 @@ static void test_in_trigger_software(CuTest *tc)
wrtd
=
wrtd_open
(
1
);
CuAssertIntEquals
(
tc
,
0
,
!
wrtd
);
/* It does not m
e
tter which channel we query, the sent triggers
/* It does not m
a
tter which channel we query, the sent triggers
value is global */
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd
,
0
,
&
st
));
sent
=
st
.
sent_packets
;
...
...
software/unittest/wrtd-ut-op.c
View file @
4c034667
...
...
@@ -340,7 +340,7 @@ static void test_msg_time(CuTest *tc)
struct
wrtd_trig_id
tid_2
=
{
0
,
2
,
2
};
struct
wrtd_trigger_handle
h_1
;
struct
wrtd_input_state
sti1
,
sti2
;
struct
wrtd_output_state
sto1
,
sto2
;
struct
wrtd_output_state
sto1
;
const
uint64_t
tdelay
=
200
*
1000
*
1000
;
wrtd_0
=
wrtd_open
(
1
);
...
...
@@ -354,7 +354,7 @@ static void test_msg_time(CuTest *tc)
/* Assign trigger input */
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_trigger_assign
(
wrtd_1
,
0
,
&
tid_1
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_trigger_assign
(
wrtd_1
,
1
,
&
tid_2
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_trigger_mode_set
(
wrtd_1
,
0
,
WRTD_TRIGGER_MODE_
SINGLE
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_trigger_mode_set
(
wrtd_1
,
0
,
WRTD_TRIGGER_MODE_
AUTO
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_trigger_mode_set
(
wrtd_1
,
1
,
WRTD_TRIGGER_MODE_AUTO
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_dead_time_set
(
wrtd_1
,
0
,
80
*
1000
*
1000
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_dead_time_set
(
wrtd_1
,
1
,
80
*
1000
*
1000
));
...
...
@@ -382,11 +382,14 @@ static void test_msg_time(CuTest *tc)
/* Stop getting pulses from pulse-generator */
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_enable
(
wrtd_1
,
0
,
0
));
sleep
(
4
);
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_enable
(
wrtd_1
,
1
,
0
));
// CuAssertIntEquals(tc, 0, wrtd_out_enable(wrtd_0, 0, 0));
// CuAssertIntEquals(tc, 0, wrtd_out_enable(wrtd_0, 1, 0));
sleep
(
2
);
// Disable channel
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_enable
(
wrtd_1
,
1
,
0
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_enable
(
wrtd_0
,
0
,
0
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_enable
(
wrtd_0
,
1
,
0
));
// Gather stats.
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd_1
,
0
,
&
sti1
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_state_get
(
wrtd_0
,
0
,
&
sto1
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd_1
,
1
,
&
sti2
));
...
...
@@ -397,15 +400,11 @@ static void test_msg_time(CuTest *tc)
/* Last sent trigger is the last executed */
CuAssertIntEquals
(
tc
,
sti1
.
last_sent
.
seq
,
sto1
.
last_executed
.
seq
);
CuAssertIntEquals
(
tc
,
sti2
.
last_sent
.
seq
,
sto2
.
last_executed
.
seq
);
CuAssertIntEquals
(
tc
,
0
,
memcmp
(
&
sti1
.
last_sent
.
id
,
&
sto1
.
last_executed
.
id
,
sizeof
(
struct
wrtd_trig_id
)));
CuAssertIntEquals
(
tc
,
0
,
memcmp
(
&
sti2
.
last_sent
.
id
,
&
sto2
.
last_executed
.
id
,
sizeof
(
struct
wrtd_trig_id
)));
//
CuAssertIntEquals(tc, 0, wrtd_out_trig_unassign(wrtd_0, &h_1));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_trig_unassign
(
wrtd_0
,
&
h_1
));
/* Close */
wrtd_close
(
wrtd_0
);
...
...
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