Skip to content

Commit

Permalink
fix(lint): Fix linter errors (#566)
Browse files Browse the repository at this point in the history
* fix(lint): Fix linter errors

* Fix

* fix
  • Loading branch information
GoetzGoerisch authored Jul 20, 2023
1 parent c885f91 commit 7126e56
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 37 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Build
name: Build

on:
push:
pull_request:
branches: [main, development]
on:
push:
pull_request:
branches: [main, development]
merge_group:

jobs:
jobs:
build-linux:
strategy:
matrix:
Expand Down
56 changes: 26 additions & 30 deletions OpcUaClient/Converter/UaToModelConverter.cpp
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2019-2021 (c) Christian von Arnim, ISW University of Stuttgart (for umati and VDW e.V.)
* Copyright 2020 (c) Dominik Basner, Sotec GmbH (for VDW e.V.)
* Copyright 2021 (c) Marius Dege, basysKom GmbH
* Copyright 2023 (c) Sebastian Friedl, FVA GmbH interop4X
*
* Copyright (c) 2019-2021 Christian von Arnim, ISW University of Stuttgart (for umati and VDW e.V.)
* Copyright (c) 2020 Dominik Basner, Sotec GmbH (for VDW e.V.)
* Copyright (c) 2021 Marius Dege, basysKom GmbH
* Copyright (c) 2023 Sebastian Friedl, FVA GmbH interop4X
*/

#include "UaToModelConverter.hpp"
#include <easylogging++.h>

namespace Umati {
namespace OpcUa {
namespace Converter {

UaToModelConverter::UaToModelConverter(const std::map<uint16_t, std::string> &idToUri) : m_idToUri(
idToUri) {
}
namespace OpcUa {
namespace Converter {

UaToModelConverter::~UaToModelConverter() = default;
UaToModelConverter::UaToModelConverter(const std::map<uint16_t, std::string> &idToUri) : m_idToUri(idToUri) {}

UaToModelConverter::~UaToModelConverter() = default;

std::string UaToModelConverter::getUriFromNsIndex(uint16_t nsIndex) {
// the opc ua standard allows to remove the nsIndex for the namespace zero
// so the converter only use this nsIndex
if (nsIndex == 0) {
return std::string();
}
// FIX_END
std::string UaToModelConverter::getUriFromNsIndex(uint16_t nsIndex) {
// the opc ua standard allows to remove the nsIndex for the namespace zero
// so the converter only use this nsIndex
if (nsIndex == 0) {
return std::string();
}
// FIX_END

auto it = m_idToUri.find(nsIndex);
if (it == m_idToUri.end()) {
LOG(ERROR) << "Could not find nsIndex: " << nsIndex << std::endl;
return std::string();
}
auto it = m_idToUri.find(nsIndex);
if (it == m_idToUri.end()) {
LOG(ERROR) << "Could not find nsIndex: " << nsIndex << std::endl;
return std::string();
}

return it->second;
}
}
}
return it->second;
}
} // namespace Converter
} // namespace OpcUa
} // namespace Umati
2 changes: 1 addition & 1 deletion Tests/unit/TestCaCertificate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TEST(OpcUaClient, CaCertificateLinux_SSLCerts) {
Umati::Util::ConfigureLogger("DashboardOpcUaClient");
Umati::Util::ConfigurationJsonFile conf("ConfigurationCa.json");

EXPECT_NO_THROW(Umati::MqttPublisher_Paho::MqttPublisher_Paho publisher(
EXPECT_NO_THROW(Umati::MqttPublisher_Paho::MqttPublisher_Paho publisher(
conf.getMqtt().Protocol,
conf.getMqtt().Hostname,
conf.getMqtt().Port,
Expand Down

0 comments on commit 7126e56

Please sign in to comment.