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

[Process] Unit name handling #1925

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Conversation

Peguen
Copy link
Contributor

@Peguen Peguen commented Jan 21, 2025

Description

Removed SetUnitName from API in C++, C and Python.
Changed UnitName generation in globals to use EcalUtils function.

@Peguen Peguen requested a review from KerstinKeller January 21, 2025 13:08
@Peguen Peguen added the cherry-pick-to-NONE Don't cherry-pick these changes label Jan 21, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -22,6 +22,8 @@
#include <ecal/ecal_process.h>
#include <ecal/ecal_defs.h>

#include <ecal_utils/filesystem.h>

#include <gtest/gtest.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]

#include <gtest/gtest.h>
         ^

}

TEST(core_cpp_core, SetGetUnitName)
TEST(core_cpp_core, GetUnitName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: all parameters should be named in a function [readability-named-parameter]

Suggested change
TEST(core_cpp_core, GetUnitName)
TEST(core_cpp_core /*unused*/, GetUnitName /*unused*/)

@@ -118,17 +93,9 @@
EXPECT_EQ(true, eCAL::IsInitialized());

// if we call eCAL_Initialize with empty unit name, eCAL will use the process name as unit name
std::string process_name = extractProcessName(eCAL::Process::GetProcessName());
std::string process_name = EcalUtils::Filesystem::BaseName(eCAL::Process::GetProcessName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'process_name' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness]

Suggested change
std::string process_name = EcalUtils::Filesystem::BaseName(eCAL::Process::GetProcessName());
std::string const process_name = EcalUtils::Filesystem::BaseName(eCAL::Process::GetProcessName());

@@ -22,6 +22,8 @@
#include <ecal/ecal_defs.h>
#include <ecal/ecal_os.h>

#include <ecal_utils/filesystem.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'ecal_utils/filesystem.h' file not found [clang-diagnostic-error]

#include <ecal_utils/filesystem.h>
         ^

}

TEST(core_c_core, SetGetUnitName)
TEST(core_c_core, GetUnitName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: all parameters should be named in a function [readability-named-parameter]

Suggested change
TEST(core_c_core, GetUnitName)
TEST(core_c_core /*unused*/, GetUnitName /*unused*/)

Copy link
Contributor

@KerstinKeller KerstinKeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@KerstinKeller KerstinKeller merged commit 34163c1 into master Jan 22, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-to-NONE Don't cherry-pick these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants