Browse Source

Address SonarLint findings in Class representation class

Patrick-Christopher Mattulat 1 year ago
parent
commit
317644a498
3 changed files with 6 additions and 6 deletions
  1. 2 2
      include/ls-std/core/Class.hpp
  2. 2 2
      source/ls-std/core/Class.cpp
  3. 2 2
      test/cases/core/ClassTest.cpp

+ 2 - 2
include/ls-std/core/Class.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2023-02-06
+ * Changed:         2023-05-15
  *
  * */
 
@@ -22,7 +22,7 @@ namespace ls::std::core
       explicit Class(const ::std::string &_name);
       virtual ~Class();
 
-      [[nodiscard]] ::std::string getClassName();
+      [[nodiscard]] ::std::string getClassName() const;
 
     private:
 

+ 2 - 2
source/ls-std/core/Class.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2023-02-23
+ * Changed:         2023-05-15
  *
  * */
 
@@ -21,7 +21,7 @@ Class::Class(const string &_name)
 
 Class::~Class() = default;
 
-string Class::getClassName()
+string Class::getClassName() const
 {
   return this->name;
 }

+ 2 - 2
test/cases/core/ClassTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-16
- * Changed:         2023-03-25
+ * Changed:         2023-05-15
  *
  * */
 
@@ -46,7 +46,7 @@ namespace
 
   TEST_F(ClassTest, destructor)
   {
-    shared_ptr<ClassWrapper> object = make_shared<ClassWrapper>();
+    auto object = make_shared<ClassWrapper>();
     EXPECT_CALL(*object, Die());
   }