Browse Source

Improved Integer class

- removed stream operators from Integer class (not
working)
- removed dead code from tests of Integer class
Patrick 4 years ago
parent
commit
8ec22cfea3
2 changed files with 2 additions and 27 deletions
  1. 2 15
      source/boxing/Integer.hpp
  2. 0 12
      test/cases/boxing/IntegerTest.cpp

+ 2 - 15
source/boxing/Integer.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2020-08-23
+ * Changed:         2020-08-25
  *
  * */
 
@@ -72,19 +72,6 @@ namespace ls_std {
       bool operator<=(const Integer& _integer) const;
       bool operator<=(int _value) const;
 
-      // stream operators
-
-      // TODO: not compilable
-//      friend std::ostream& operator<<(std::ostream& outputStream, const Integer& _integer) {
-//        outputStream << _integer.value;
-//        return outputStream;
-//      }
-//
-//      friend std::istream& operator>>(std::istream& inputStream, Integer& _integer) {
-//        inputStream >> _integer.value;
-//        return inputStream;
-//      }
-
       // logical operators
 
       friend bool operator!(const Integer& _integer) {
@@ -120,9 +107,9 @@ namespace ls_std {
 
     private:
 
-      int value {};
       std::shared_ptr<ISerializable> serializable {};
       std::shared_ptr<IStorable> storable {};
+      int value {};
   };
 }
 

+ 0 - 12
test/cases/boxing/IntegerTest.cpp

@@ -265,18 +265,6 @@ namespace {
     ASSERT_FALSE(x <= y);
   }
 
-  // stream operators / input stream not testable by using automated tests
-
-  // TODO: not compilable
-//  TEST_F(IntegerTest, operatorOutputStream)
-//  {
-//    ls_std::Integer x {10};
-//    std::ostringstream _stream {};
-//    _stream << x;
-//
-//    ASSERT_STREQ("10", _stream.str().c_str());
-//  }
-
   // logical operators
 
   TEST_F(IntegerTest, operatorNot)