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
fa795859
Commit
fa795859
authored
Sep 04, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unittest: adjust test_msg_mix.
parent
45e4b022
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
wrtd-ut-op.c
software/unittest/wrtd-ut-op.c
+30
-15
No files found.
software/unittest/wrtd-ut-op.c
View file @
fa795859
...
...
@@ -213,8 +213,8 @@ static void test_msg_mix(CuTest *tc)
struct
wrtd_trig_id
tid_3
=
{
1
,
0
,
1
};
struct
wrtd_trig_id
tid_4
=
{
1
,
1
,
1
};
struct
wrtd_trigger_handle
h_1
,
h_2
,
h_3
;
struct
wrtd_input_state
sti
1
,
sti2
;
struct
wrtd_output_state
sto
1
,
sto2
;
struct
wrtd_input_state
sti
_l1c0
,
sti_l1c1
,
sti_l0c0
,
sti_l0c1
;
struct
wrtd_output_state
sto
_l0c0
,
sto_l0c1
,
sto_l1c0
;
const
uint64_t
tdelay
=
200
*
1000
*
1000
;
wrtd_0
=
wrtd_open
(
1
);
...
...
@@ -295,24 +295,39 @@ static void test_msg_mix(CuTest *tc)
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_enable
(
wrtd_1
,
0
,
0
));
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
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_state_get
(
wrtd_0
,
1
,
&
sto2
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd_0
,
0
,
&
sti_l0c0
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd_0
,
1
,
&
sti_l0c1
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd_1
,
0
,
&
sti_l1c0
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_in_state_get
(
wrtd_1
,
1
,
&
sti_l1c1
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_state_get
(
wrtd_0
,
0
,
&
sto_l0c0
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_state_get
(
wrtd_0
,
1
,
&
sto_l0c1
));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_state_get
(
wrtd_1
,
0
,
&
sto_l1c0
));
/* Sent and received messages are the same */
CuAssertIntEquals
(
tc
,
sti1
.
sent_triggers
,
sto1
.
executed_pulses
);
CuAssertIntEquals
(
tc
,
sti2
.
sent_triggers
,
sto2
.
executed_pulses
);
CuAssertIntEquals
(
tc
,
sti1
.
sent_triggers
,
sti2
.
sent_triggers
);
CuAssertIntEquals
(
tc
,
sti_l1c0
.
sent_triggers
,
sto_l0c1
.
executed_pulses
);
CuAssertIntEquals
(
tc
,
sti_l0c0
.
sent_triggers
,
sto_l1c0
.
executed_pulses
);
CuAssertIntEquals
(
tc
,
sti_l0c1
.
sent_triggers
,
sto_l0c0
.
executed_pulses
);
/* Same number of sent and received pulses */
CuAssertIntEquals
(
tc
,
sto_l0c1
.
executed_pulses
,
sti_l0c0
.
sent_triggers
);
CuAssertIntEquals
(
tc
,
sto_l1c0
.
executed_pulses
,
sti_l0c1
.
sent_triggers
);
CuAssertIntEquals
(
tc
,
sto_l0c0
.
executed_pulses
,
sti_l1c1
.
sent_triggers
);
/* 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
,
CuAssertIntEquals
(
tc
,
sti_l1c0
.
last_sent
.
seq
,
sto_l0c1
.
last_executed
.
seq
);
CuAssertIntEquals
(
tc
,
sti_l0c0
.
last_sent
.
seq
,
sto_l1c0
.
last_executed
.
seq
);
CuAssertIntEquals
(
tc
,
sti_l0c1
.
last_sent
.
seq
,
sto_l0c0
.
last_executed
.
seq
);
CuAssertIntEquals
(
tc
,
0
,
memcmp
(
&
sti_l1c0
.
last_sent
.
id
,
&
sto_l0c1
.
last_executed
.
id
,
sizeof
(
struct
wrtd_trig_id
)));
CuAssertIntEquals
(
tc
,
0
,
memcmp
(
&
sti_l0c0
.
last_sent
.
id
,
&
sto_l1c0
.
last_executed
.
id
,
sizeof
(
struct
wrtd_trig_id
)));
CuAssertIntEquals
(
tc
,
0
,
memcmp
(
&
sti
2
.
last_sent
.
id
,
&
sto
2
.
last_executed
.
id
,
CuAssertIntEquals
(
tc
,
0
,
memcmp
(
&
sti
_l0c1
.
last_sent
.
id
,
&
sto
_l0c0
.
last_executed
.
id
,
sizeof
(
struct
wrtd_trig_id
)));
CuAssertIntEquals
(
tc
,
0
,
wrtd_out_trig_unassign
(
wrtd_1
,
&
h_1
));
...
...
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