Skip to content

Commit 8c0609a

Browse files
committed
clang-tidy fixes: std::endl -> '\n'
1 parent 45ea86c commit 8c0609a

14 files changed

+23
-23
lines changed

core/src/container.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,24 @@ printChildrenInterfaces(const ContainerBasePrivate& container, bool success, con
6262
std::ostream& os = std::cerr) {
6363
static unsigned int id = 0;
6464
const unsigned int width = 10; // indentation of name
65-
os << std::endl << (success ? '+' : '-') << ' ' << creator.name() << ' ';
65+
os << '\n' << (success ? '+' : '-') << ' ' << creator.name() << ' ';
6666
if (success)
6767
os << ++id << ' ';
6868
if (const auto conn = dynamic_cast<const ConnectingPrivate*>(creator.pimpl()))
6969
os << conn->pendingPairsPrinter();
70-
os << std::endl;
70+
os << '\n';
7171

7272
for (const auto& child : container.children()) {
7373
auto cimpl = child->pimpl();
7474
os << std::setw(width) << std::left << child->name();
7575
if (!cimpl->starts() && !cimpl->ends())
76-
os << "" << std::endl;
76+
os << "\n";
7777
if (cimpl->starts())
78-
os << "" << *child->pimpl()->starts() << std::endl;
78+
os << "" << *child->pimpl()->starts() << '\n';
7979
if (cimpl->starts() && cimpl->ends())
8080
os << std::setw(width) << " ";
8181
if (cimpl->ends())
82-
os << "" << *child->pimpl()->ends() << std::endl;
82+
os << "" << *child->pimpl()->ends() << '\n';
8383
}
8484
}
8585

@@ -459,7 +459,7 @@ void ContainerBase::explainFailure(std::ostream& os) const {
459459
if (stage->numFailures()) {
460460
os << stage->name() << " (0/" << stage->numFailures() << ")";
461461
stage->explainFailure(os);
462-
os << std::endl;
462+
os << '\n';
463463
break;
464464
}
465465
stage->explainFailure(os); // recursively process children
@@ -468,7 +468,7 @@ void ContainerBase::explainFailure(std::ostream& os) const {
468468

469469
std::ostream& operator<<(std::ostream& os, const ContainerBase& container) {
470470
ContainerBase::StageCallback processor = [&os](const Stage& stage, unsigned int depth) -> bool {
471-
os << std::string(2 * depth, ' ') << *stage.pimpl() << std::endl;
471+
os << std::string(2 * depth, ' ') << *stage.pimpl() << '\n';
472472
return true;
473473
};
474474
container.traverseRecursively(processor);

core/src/introspection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void Introspection::publishAllSolutions(bool wait) {
171171
publishSolution(*solution);
172172

173173
if (wait) {
174-
std::cout << "Press <Enter> to continue ..." << std::endl;
174+
std::cout << "Press <Enter> to continue ...\n";
175175
int ch = getchar();
176176
if (ch == 'q' || ch == 'Q')
177177
break;

core/src/stage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ const char* InitStageException::what() const noexcept {
9090
}
9191

9292
std::ostream& operator<<(std::ostream& os, const InitStageException& e) {
93-
os << "Error initializing stage" << (e.errors_.size() > 1 ? "s" : "") << ":" << std::endl;
93+
os << "Error initializing stage" << (e.errors_.size() > 1 ? "s" : "") << ":\n ";
9494
for (const auto& pair : e.errors_)
95-
os << pair.first->name() << ": " << pair.second << std::endl;
95+
os << pair.first->name() << ": " << pair.second << '\n';
9696
return os;
9797
}
9898

@@ -840,10 +840,10 @@ void ConnectingPrivate::newState(Interface::iterator it, Interface::UpdateFlags
840840
os << (updated ? " !" : " +");
841841
else
842842
os << " ";
843-
os << d << " " << this->pullInterface(d) << ": " << *this->pullInterface(d) << std::endl;
843+
os << d << " " << this->pullInterface(d) << ": " << *this->pullInterface(d) << '\n';
844844
}
845845
os << std::setw(15) << " ";
846-
os << pendingPairsPrinter() << std::endl;
846+
os << pendingPairsPrinter() << '\n';
847847
#endif
848848
}
849849

core/test/pick_pa10.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ TEST(PA10, pick) {
179179
try {
180180
t.plan();
181181
} catch (const InitStageException& e) {
182-
ADD_FAILURE() << "planning failed with exception" << std::endl << e << t;
182+
ADD_FAILURE() << "planning failed with exception\n" << e << t;
183183
}
184184

185185
auto solutions = t.solutions().size();

core/test/pick_pr2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ TEST(PR2, pick) {
7777
spawnObject();
7878
t.plan();
7979
} catch (const InitStageException& e) {
80-
ADD_FAILURE() << "planning failed with exception" << std::endl << e << t;
80+
ADD_FAILURE() << "planning failed with exception\n" << e << t;
8181
}
8282

8383
auto solutions = t.solutions().size();

core/test/pick_ur5.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ TEST(UR5, pick) {
7979
spawnObject();
8080
t.plan();
8181
} catch (const InitStageException& e) {
82-
ADD_FAILURE() << "planning failed with exception" << std::endl << e << t;
82+
ADD_FAILURE() << "planning failed with exception\n" << e << t;
8383
}
8484

8585
auto solutions = t.solutions().size();

core/test/test_container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ TEST(Task, reuse) {
625625
configure(t);
626626
EXPECT_TRUE(t.plan(1));
627627
} catch (const InitStageException& e) {
628-
ADD_FAILURE() << "InitStageException:" << std::endl << e << t;
628+
ADD_FAILURE() << "InitStageException:\n" << e << t;
629629
}
630630
}
631631

core/test/test_cost_queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ TYPED_TEST(OrderedTest, sorting) {
126126
template <typename ValueType, typename CostType>
127127
std::ostream& operator<<(std::ostream& os, const cost_ordered<ValueType, CostType>& queue) {
128128
for (const auto& pair : queue.sorted())
129-
os << pair.cost() << ": " << pair.value() << std::endl;
129+
os << pair.cost() << ": " << pair.value() << '\n';
130130
return os;
131131
}
132132

core/test/test_move_to.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ TEST(Task, taskMoveConstructor) {
201201
t.init();
202202
EXPECT_TRUE(t.plan(1));
203203
} catch (const InitStageException& e) {
204-
ADD_FAILURE() << "InitStageException:" << std::endl << e << t;
204+
ADD_FAILURE() << "InitStageException:\n" << e << t;
205205
}
206206
}
207207

demo/src/alternative_path_costs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main(int argc, char** argv) {
7373
try {
7474
t.plan(0);
7575
} catch (const InitStageException& e) {
76-
std::cout << e << std::endl;
76+
std::cout << e << '\n';
7777
}
7878

7979
ros::spin();

0 commit comments

Comments
 (0)