701 Update LogService class in CppMicroServices (#1009)#1163
701 Update LogService class in CppMicroServices (#1009)#1163jeffdiclemente merged 3 commits intoCppMicroServices:c++14-compliantfrom
Conversation
* Update LogService class --------- Co-authored-by: Archita P <architap@mathworks.com>
| * @remarks This class is thread safe. | ||
| */ | ||
| class LogService | ||
| class LogService : public LoggerFactory |
There was a problem hiding this comment.
warning: class 'LogService' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class LogService : public LoggerFactory
^| #include <functional> | ||
| #include <string> | ||
|
|
||
| namespace cppmicroservices::logservice |
There was a problem hiding this comment.
warning: nested namespace definition is a C++17 extension; define each namespace separately [clang-diagnostic-c++17-extensions]
| namespace cppmicroservices::logservice | |
| namespace cppmicroservices { namespace logservice |
compendium/LogService/include/cppmicroservices/logservice/Logger.hpp:317:
- } // namespace cppmicroservices::logservice
+ } } // namespace cppmicroservices::logserviceThere was a problem hiding this comment.
| namespace cppmicroservices::logservice | |
| namespace cppmicroservices | |
| { | |
| namespace logservice |
| * @remarks This class is thread-safe. | ||
| */ | ||
|
|
||
| class Logger |
There was a problem hiding this comment.
warning: class 'Logger' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class Logger
^| * @remarks This class is thread safe. | ||
| */ | ||
|
|
||
| class LoggerFactory |
There was a problem hiding this comment.
warning: class 'LoggerFactory' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class LoggerFactory
^| return stream.str(); | ||
| } | ||
|
|
||
| namespace cppmicroservices::logservice |
There was a problem hiding this comment.
warning: nested namespace definition is a C++17 extension; define each namespace separately [clang-diagnostic-c++17-extensions]
| namespace cppmicroservices::logservice | |
| namespace cppmicroservices { namespace logservice |
compendium/LogServiceImpl/src/LogServiceImpl.cpp:96:
- } // namespace cppmicroservices::logservice
+ } } // namespace cppmicroservices::logservice| EXPECT_NO_THROW(logger->info("Test invalid exception_ptr", exp)); | ||
| EXPECT_TRUE(ContainsRegex(log_preamble + "Test invalid exception_ptr(\\n)" + exception_preamble + "none")); | ||
|
|
||
| EXPECT_NO_THROW(logger->info("Test invalid ServiceReferenceBase object", cppmicroservices::ServiceReferenceU {}, |
There was a problem hiding this comment.
warning: avoid using 'goto' for flow control [cppcoreguidelines-avoid-goto]
EXPECT_NO_THROW(logger->info("Test invalid ServiceReferenceBase object", cppmicroservices::ServiceReferenceU {},
^expanded from here
| + "Invalid service reference(\\n)" + exception_preamble + "none")); | ||
| } | ||
|
|
||
| TEST_F(LoggerImplTests, ThreadSafety) |
There was a problem hiding this comment.
warning: initializing non-owner argument of type 'TestFactoryBase *' with a newly created 'gsl::owner<>' [cppcoreguidelines-owning-memory]
TEST_F(LoggerImplTests, ThreadSafety)
^Additional context
third_party/googletest/googletest/include/gtest/gtest.h:2207: expanded from macro 'TEST_F'
#define TEST_F(test_fixture, test_name) GTEST_TEST_F(test_fixture, test_name)
^third_party/googletest/googletest/include/gtest/gtest.h:2204: expanded from macro 'GTEST_TEST_F'
GTEST_TEST_(test_fixture, test_name, test_fixture, \
^third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:1555: expanded from macro 'GTEST_TEST_'
new ::testing::internal::TestFactoryImpl<GTEST_TEST_CLASS_NAME_( \
^| #include <memory> | ||
| #include <thread> | ||
|
|
||
| #include <gmock/gmock.h> |
There was a problem hiding this comment.
warning: 'gmock/gmock.h' file not found [clang-diagnostic-error]
#include <gmock/gmock.h>
^| namespace cfrimpl | ||
| { | ||
| // The fixture for testing class CFRLogger. | ||
| class CFRLoggerTest : public ::testing::Test |
There was a problem hiding this comment.
warning: class 'CFRLoggerTest' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class CFRLoggerTest : public ::testing::Test
^| namespace cfrimpl | ||
| { | ||
| // The fixture for testing class CFRLogger. | ||
| class CFRLoggerTest : public ::testing::Test |
There was a problem hiding this comment.
warning: destructor of 'CFRLoggerTest' is protected and virtual [cppcoreguidelines-virtual-class-destructor]
class CFRLoggerTest : public ::testing::Test
^Additional context
framework/test/gtest/CFRLoggerTest.cpp:55: make it protected and non-virtual
class CFRLoggerTest : public ::testing::Test
^
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## c++14-compliant #1163 +/- ##
===================================================
- Coverage 86.04% 83.41% -2.63%
===================================================
Files 133 123 -10
Lines 7508 5126 -2382
===================================================
- Hits 6460 4276 -2184
+ Misses 1048 850 -198
🚀 New features to boost your workflow:
|
4687f17
into
CppMicroServices:c++14-compliant
cherry-pick of commit 070fd93 (PR #1009)
plus additional commit for C++14 compliance
see discussion #701