Commit d36f1bdb by Tobias Schuele

Fixed typos in condition_var_test.cc

parent 3577c136
...@@ -38,7 +38,7 @@ ConditionVarTest::ConditionVarTest() ...@@ -38,7 +38,7 @@ ConditionVarTest::ConditionVarTest()
embb_condition_init(&cond_wait_); embb_condition_init(&cond_wait_);
embb_mutex_init(&mutex_cond_wait_, EMBB_MUTEX_PLAIN); embb_mutex_init(&mutex_cond_wait_, EMBB_MUTEX_PLAIN);
CreateUnit("Timed wait timouts") CreateUnit("Timed wait timeouts")
.Add(&ConditionVarTest::TestTimedWaitTimeouts, this); .Add(&ConditionVarTest::TestTimedWaitTimeouts, this);
if (num_threads_ >= 2) { if (num_threads_ >= 2) {
CreateUnit("Condition Notify Test") CreateUnit("Condition Notify Test")
...@@ -64,10 +64,10 @@ void ConditionVarTest::TestNotify() { ...@@ -64,10 +64,10 @@ void ConditionVarTest::TestNotify() {
while (embb_counter_get(&counter_) while (embb_counter_get(&counter_)
< static_cast<unsigned int>(num_threads_-1)) < static_cast<unsigned int>(num_threads_-1))
{} // all threads entered critical section {} // All threads entered critical section
embb_mutex_lock(&mutex_cond_notify_); embb_mutex_lock(&mutex_cond_notify_);
embb_mutex_unlock(&mutex_cond_notify_); embb_mutex_unlock(&mutex_cond_notify_);
// All threads called wait on the condition (Even last thread) // All threads called wait on the condition (even last thread)
embb_counter_init(&counter_); embb_counter_init(&counter_);
...@@ -75,7 +75,7 @@ void ConditionVarTest::TestNotify() { ...@@ -75,7 +75,7 @@ void ConditionVarTest::TestNotify() {
embb_mutex_lock(&mutex_cond_wait_); embb_mutex_lock(&mutex_cond_wait_);
embb_condition_wait_for(&cond_wait_, &mutex_cond_wait_, &duration); embb_condition_wait_for(&cond_wait_, &mutex_cond_wait_, &duration);
while (embb_counter_get(&counter_) == 0) while (embb_counter_get(&counter_) == 0)
{} //if hangs here signal has not succeded {} // If test hangs here, signalling has not succeeded
PT_ASSERT_EQ_MSG(embb_counter_get(&counter_), static_cast<unsigned int>(1), PT_ASSERT_EQ_MSG(embb_counter_get(&counter_), static_cast<unsigned int>(1),
"Only one thread notified"); "Only one thread notified");
...@@ -85,7 +85,7 @@ void ConditionVarTest::TestNotify() { ...@@ -85,7 +85,7 @@ void ConditionVarTest::TestNotify() {
while (embb_counter_get(&counter_) != while (embb_counter_get(&counter_) !=
static_cast<unsigned int>(num_threads_-1)) static_cast<unsigned int>(num_threads_-1))
{} // If this hangs then not all threads were notified. {} // If test hangs here, not all threads were notified
embb_mutex_unlock(&mutex_cond_wait_); embb_mutex_unlock(&mutex_cond_wait_);
embb_mutex_destroy(&mutex_cond_wait_); embb_mutex_destroy(&mutex_cond_wait_);
...@@ -111,7 +111,7 @@ void ConditionVarTest::TestTimedWaitTimeouts() { ...@@ -111,7 +111,7 @@ void ConditionVarTest::TestTimedWaitTimeouts() {
int status = embb_condition_wait_until(&cond, &mutex, &time); int status = embb_condition_wait_until(&cond, &mutex, &time);
PT_EXPECT_EQ(status, EMBB_TIMEDOUT); PT_EXPECT_EQ(status, EMBB_TIMEDOUT);
// Wait for a future timepoint // Wait for a future time point
status = embb_duration_set_milliseconds(&duration, 1); status = embb_duration_set_milliseconds(&duration, 1);
PT_EXPECT_EQ(status, EMBB_SUCCESS); PT_EXPECT_EQ(status, EMBB_SUCCESS);
status = embb_time_in(&time, &duration); // Time now status = embb_time_in(&time, &duration); // Time now
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment