Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d36f1bdb
authored
Sep 01, 2015
by
Tobias Schuele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed typos in condition_var_test.cc
parent
3577c136
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
base_c/test/condition_var_test.cc
+6
-6
No files found.
base_c/test/condition_var_test.cc
View file @
d36f1bdb
...
...
@@ -38,7 +38,7 @@ ConditionVarTest::ConditionVarTest()
embb_condition_init
(
&
cond_wait_
);
embb_mutex_init
(
&
mutex_cond_wait_
,
EMBB_MUTEX_PLAIN
);
CreateUnit
(
"Timed wait timouts"
)
CreateUnit
(
"Timed wait tim
e
outs"
)
.
Add
(
&
ConditionVarTest
::
TestTimedWaitTimeouts
,
this
);
if
(
num_threads_
>=
2
)
{
CreateUnit
(
"Condition Notify Test"
)
...
...
@@ -64,10 +64,10 @@ void ConditionVarTest::TestNotify() {
while
(
embb_counter_get
(
&
counter_
)
<
static_cast
<
unsigned
int
>
(
num_threads_
-
1
))
{}
//
a
ll threads entered critical section
{}
//
A
ll threads entered critical section
embb_mutex_lock
(
&
mutex_cond_notify_
);
embb_mutex_unlock
(
&
mutex_cond_notify_
);
// All threads called wait on the condition (
E
ven last thread)
// All threads called wait on the condition (
e
ven last thread)
embb_counter_init
(
&
counter_
);
...
...
@@ -75,7 +75,7 @@ void ConditionVarTest::TestNotify() {
embb_mutex_lock
(
&
mutex_cond_wait_
);
embb_condition_wait_for
(
&
cond_wait_
,
&
mutex_cond_wait_
,
&
duration
);
while
(
embb_counter_get
(
&
counter_
)
==
0
)
{}
//
if hangs here signal has not succ
eded
{}
//
If test hangs here, signalling has not succe
eded
PT_ASSERT_EQ_MSG
(
embb_counter_get
(
&
counter_
),
static_cast
<
unsigned
int
>
(
1
),
"Only one thread notified"
);
...
...
@@ -85,7 +85,7 @@ void ConditionVarTest::TestNotify() {
while
(
embb_counter_get
(
&
counter_
)
!=
static_cast
<
unsigned
int
>
(
num_threads_
-
1
))
{}
// If t
his hangs then not all threads were notified.
{}
// If t
est hangs here, not all threads were notified
embb_mutex_unlock
(
&
mutex_cond_wait_
);
embb_mutex_destroy
(
&
mutex_cond_wait_
);
...
...
@@ -111,7 +111,7 @@ void ConditionVarTest::TestTimedWaitTimeouts() {
int
status
=
embb_condition_wait_until
(
&
cond
,
&
mutex
,
&
time
);
PT_EXPECT_EQ
(
status
,
EMBB_TIMEDOUT
);
// Wait for a future timepoint
// Wait for a future time
point
status
=
embb_duration_set_milliseconds
(
&
duration
,
1
);
PT_EXPECT_EQ
(
status
,
EMBB_SUCCESS
);
status
=
embb_time_in
(
&
time
,
&
duration
);
// Time now
...
...
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