remove obsolete INDENT-OFF usage

This commit is contained in:
Dirk Thomas 2017-09-29 10:33:13 -07:00
parent 72bcb6b5b6
commit 54ed582ebe

View file

@ -233,10 +233,10 @@ TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), multi_wait_set_threade
};
std::vector<TestSet> test_sets(number_of_threads);
// Setup common function for waiting on the triggered guard conditions.
// *INDENT-OFF* (prevent uncrustify from making unnecessary indents here)
auto wait_func_factory = [count_target, retry_limit, wait_period](TestSet & test_set)
{
return [&test_set, count_target, retry_limit, wait_period]() {
auto wait_func_factory =
[count_target, retry_limit, wait_period](TestSet & test_set) {
return
[&test_set, count_target, retry_limit, wait_period]() {
while (test_set.wake_count < count_target) {
bool change_detected = false;
size_t wake_try_count = 0;
@ -254,15 +254,16 @@ TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), multi_wait_set_threade
// if not timeout, then the single guard condition should be set
if (!test_set.wait_set.guard_conditions[0]) {
test_set.wake_count.store(count_target + 1); // indicates an error
ASSERT_NE(nullptr, test_set.wait_set.guard_conditions[0])
<< "[thread " << test_set.thread_id
<< "] expected guard condition to be marked ready after non-timeout wake up";
ASSERT_NE(nullptr, test_set.wait_set.guard_conditions[0]) <<
"[thread " << test_set.thread_id <<
"] expected guard condition to be marked ready after non-timeout wake up";
}
// no need to wait again
break;
} else {
std::stringstream ss;
ss << "[thread " << test_set.thread_id << "] Timeout (try #" << wake_try_count << ")";
ss << "[thread " << test_set.thread_id << "] Timeout (try #" << wake_try_count <<
")";
// TODO(mikaelarguedas) replace this with stream logging once they exist
RCUTILS_LOG_INFO("%s", ss.str().c_str())
}
@ -275,7 +276,6 @@ TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), multi_wait_set_threade
}
};
};
// *INDENT-ON*
// Setup each test set.
for (auto & test_set : test_sets) {
rcl_ret_t ret;
@ -312,8 +312,8 @@ TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), multi_wait_set_threade
test_set.thread = std::thread(wait_func_factory(test_set));
}
// Loop, triggering every trigger_period until the threads are done.
// *INDENT-OFF* (prevent uncrustify from making unnecessary indents here)
auto loop_test = [&test_sets, count_target]() -> bool {
auto loop_test =
[&test_sets, count_target]() -> bool {
for (const auto & test_set : test_sets) {
if (test_set.wake_count.load() < count_target) {
return true;
@ -321,7 +321,6 @@ TEST_F(CLASSNAME(WaitSetTestFixture, RMW_IMPLEMENTATION), multi_wait_set_threade
}
return false;
};
// *INDENT-ON*
size_t loop_count = 0;
while (loop_test()) {
loop_count++;