Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run clang-tidy #70

Merged
merged 3 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MaeBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ bool Block::operator==(const Block& rhs) const
return true;
}

bool IndexedBlockMapI::operator==(const IndexedBlockMapI& rhs)
bool IndexedBlockMapI::operator==(const IndexedBlockMapI& rhs) const
{
const auto& block_names = getBlockNames();
for (const auto& name : block_names) {
Expand Down
2 changes: 1 addition & 1 deletion MaeBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EXPORT_MAEPARSER IndexedBlockMapI
getIndexedBlock(const std::string& name) const = 0;

virtual std::vector<std::string> getBlockNames() const = 0;
bool operator==(const IndexedBlockMapI& rhs);
bool operator==(const IndexedBlockMapI& rhs) const;
};

class EXPORT_MAEPARSER IndexedBlockMap : public IndexedBlockMapI
Expand Down
13 changes: 5 additions & 8 deletions test/MaeBlockTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <iostream>
#include <memory>
#include <stdexcept>

#include <boost/test/unit_test.hpp>
Expand Down Expand Up @@ -133,8 +134,7 @@ BOOST_AUTO_TEST_CASE(maeIndexedBlock)
dv.push_back(3.0);
IndexedBlock ib("m_atom");
BOOST_REQUIRE(!ib.hasRealProperty("r_m_float"));
auto irps = std::shared_ptr<IndexedRealProperty>(
new IndexedRealProperty(dv, bs));
auto irps = std::make_shared<IndexedRealProperty>(dv, bs);

ib.setRealProperty("r_m_float", irps);
BOOST_REQUIRE(ib.hasRealProperty("r_m_float"));
Expand Down Expand Up @@ -169,8 +169,7 @@ BOOST_AUTO_TEST_CASE(maeIndexedBlockBool)
dv.push_back(true);
IndexedBlock ib("m_atom");
BOOST_REQUIRE(!ib.hasBoolProperty("b_m_bool"));
auto ibps = std::shared_ptr<IndexedBoolProperty>(
new IndexedBoolProperty(dv, bs));
auto ibps = std::make_shared<IndexedBoolProperty>(dv, bs);

ib.setBoolProperty("b_m_bool", ibps);
BOOST_REQUIRE(ib.hasBoolProperty("b_m_bool"));
Expand Down Expand Up @@ -199,8 +198,7 @@ BOOST_AUTO_TEST_CASE(maeIndexedBlockString)
dv.push_back("Bye");
IndexedBlock ib("m_atom");
BOOST_REQUIRE(!ib.hasStringProperty("s_m_string"));
auto isps = std::shared_ptr<IndexedStringProperty>(
new IndexedStringProperty(dv, bs));
auto isps = std::make_shared<IndexedStringProperty>(dv, bs);

ib.setStringProperty("s_m_string", isps);
BOOST_REQUIRE(ib.hasStringProperty("s_m_string"));
Expand Down Expand Up @@ -234,8 +232,7 @@ std::shared_ptr<mae::IndexedBlock> getExampleIndexedBlock()
boost::dynamic_bitset<>* rbs = new boost::dynamic_bitset<>(3);
rbs->set(2);

auto irps =
std::shared_ptr<IndexedRealProperty>(new IndexedRealProperty(rv, rbs));
auto irps = std::make_shared<IndexedRealProperty>(rv, rbs);
ib->setRealProperty("r_m_reals", irps);

return ib;
Expand Down
2 changes: 1 addition & 1 deletion test/WriterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WriterGlobalFixture
public:
WriterGlobalFixture()
{
for (auto& file : generated_files) {
for (const auto& file : generated_files) {
boost::filesystem::path fpath(file);
if (boost::filesystem::exists(fpath)) {
boost::filesystem::remove(fpath);
Expand Down