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