From ed73b7315ef4c42b2c3a4abc2784e58ca369e43f Mon Sep 17 00:00:00 2001 From: Will Sobel Date: Wed, 20 Mar 2024 19:31:16 -0400 Subject: [PATCH] reformatted --- src/mtconnect/buffer/checkpoint.hpp | 8 +++++--- src/mtconnect/buffer/circular_buffer.hpp | 10 +++++----- src/mtconnect/configuration/agent_config.hpp | 4 ++-- test_package/agent_test.cpp | 6 +++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/mtconnect/buffer/checkpoint.hpp b/src/mtconnect/buffer/checkpoint.hpp index 3b20558a..7e7c582a 100644 --- a/src/mtconnect/buffer/checkpoint.hpp +++ b/src/mtconnect/buffer/checkpoint.hpp @@ -175,13 +175,15 @@ namespace mtconnect::buffer { void updateDataItems(std::unordered_map &diMap) { auto iter = m_observations.begin(); - while( iter != m_observations.end() ) + while (iter != m_observations.end()) { auto item = *iter; - if( item.second->isOrphan() ) { + if (item.second->isOrphan()) + { iter = m_observations.erase(iter); } - else { + else + { item.second->updateDataItem(diMap); iter++; } diff --git a/src/mtconnect/buffer/circular_buffer.hpp b/src/mtconnect/buffer/circular_buffer.hpp index 4d30aab4..e9b934ae 100644 --- a/src/mtconnect/buffer/circular_buffer.hpp +++ b/src/mtconnect/buffer/circular_buffer.hpp @@ -25,11 +25,10 @@ #include "checkpoint.hpp" #include "mtconnect/config.hpp" +#include "mtconnect/entity/requirement.hpp" +#include "mtconnect/logging.hpp" #include "mtconnect/observation/observation.hpp" #include "mtconnect/utilities.hpp" -#include "mtconnect/logging.hpp" -#include "mtconnect/entity/requirement.hpp" - namespace mtconnect::buffer { using SequenceNumber_t = uint64_t; @@ -87,10 +86,11 @@ namespace mtconnect::buffer { { for (auto &o : m_slidingBuffer) { - if( o->isOrphan() ) { + if (o->isOrphan()) + { continue; } - o->updateDataItem(diMap); + o->updateDataItem(diMap); } // checkpoints will remove orphans from its observations diff --git a/src/mtconnect/configuration/agent_config.hpp b/src/mtconnect/configuration/agent_config.hpp index 175d017a..61b39bbd 100644 --- a/src/mtconnect/configuration/agent_config.hpp +++ b/src/mtconnect/configuration/agent_config.hpp @@ -255,14 +255,14 @@ namespace mtconnect { if (std::filesystem::exists(tst, ec) && !ec) { LOG(debug) << "Found file '" << file << "' " - << " in path " << path; + << " in path " << path; auto con {std::filesystem::canonical(tst)}; return con; } else { LOG(debug) << "Cannot find file '" << file << "' " - << " in path " << path; + << " in path " << path; } } diff --git a/test_package/agent_test.cpp b/test_package/agent_test.cpp index 18f5887a..42f797f7 100644 --- a/test_package/agent_test.cpp +++ b/test_package/agent_test.cpp @@ -1785,9 +1785,9 @@ TEST_F(AgentTest, should_handle_uuid_change) ASSERT_XML_PATH_EQUAL(doc, "//m:Description@serialNumber", "XXXX-1234"); ASSERT_XML_PATH_EQUAL(doc, "//m:Description@station", "YYYY"); } - - auto *pipe = static_cast(m_agentTestHelper->m_adapter->getPipeline()); - + + auto *pipe = static_cast(m_agentTestHelper->m_adapter->getPipeline()); + ASSERT_EQ("MK-1234", pipe->getDevice()); {