Skip to content

Commit

Permalink
[wip] clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Apr 7, 2022
1 parent a32a033 commit 17dfba5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/podio/Association.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class AssociationT {
/// Destructor
~AssociationT() {
if (m_obj) {
m_obj->release();
m_obj->release(); // NOLINT(clang-analyzer-cplusplus.NewDelete) issue #174
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/podio/AssociationSIOBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ class AssociationSIOBlock : public podio::SIOBlock {

} // namespace podio

#endif // PODIO_ASSOCIATIONBLOCK_H
#endif // PODIO_ASSOCIATIONSIOBLOCK_H
5 changes: 3 additions & 2 deletions tests/associations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ TEST_CASE("Association basics", "[associations]") {
auto cluster = MutableExampleCluster();
auto hit = MutableExampleHit();

auto mutAssoc = TestMutA();
auto mutAssoc = TestMutA(); // NOLINT(clang-analyzer-cplusplus.NewDelete) necessary due to clang-tidy and Catch2
// SECTIONs interaction (common setup seems to confuse clang-tidy)
mutAssoc.setWeight(3.14f);
mutAssoc.setFrom(hit);
mutAssoc.setTo(cluster);
Expand Down Expand Up @@ -121,7 +122,7 @@ TEST_CASE("Association basics", "[associations]") {
}

SECTION("Equality operator") {
auto otherAssoc = mutAssoc;
auto otherAssoc = mutAssoc; // NOLINT(performance-unnecessary-copy-initialization)
REQUIRE(otherAssoc == mutAssoc);

// Mutable and immutable associations should be comparable
Expand Down

0 comments on commit 17dfba5

Please sign in to comment.