Эх сурвалжийг харах

Remove namespaces from boxing module's tests

Patrick-Christopher Mattulat 2 жил өмнө
parent
commit
ebf86c4c8d

+ 46 - 42
test/cases/boxing/BooleanTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,10 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_boxing.hpp>
 
+using namespace ls::std::boxing;
+using namespace ls::std::core;
+using namespace ::std;
+
 namespace
 {
   class BooleanTest : public ::testing::Test
@@ -31,7 +35,7 @@ namespace
 
   TEST_F(BooleanTest, operator_assignment_boolean)
   {
-    ls::std::boxing::Boolean expression{};
+    Boolean expression{};
     expression = true;
 
     ASSERT_TRUE(expression);
@@ -39,7 +43,7 @@ namespace
 
   TEST_F(BooleanTest, operator_assignment_integer)
   {
-    ls::std::boxing::Boolean expression{};
+    Boolean expression{};
     expression = 1;
 
     ASSERT_TRUE(expression);
@@ -49,8 +53,8 @@ namespace
 
   TEST_F(BooleanTest, operator_output_stream)
   {
-    ls::std::boxing::Boolean expression{true};
-    ::std::ostringstream _stream{};
+    Boolean expression{true};
+    ostringstream _stream{};
     _stream << expression;
 
     ASSERT_STREQ("true", _stream.str().c_str());
@@ -60,20 +64,20 @@ namespace
 
   TEST_F(BooleanTest, operator_negation_negative_value)
   {
-    ls::std::boxing::Boolean expression{};
+    Boolean expression{};
     ASSERT_TRUE(!expression);
   }
 
   TEST_F(BooleanTest, operator_negation_positive_value)
   {
-    ls::std::boxing::Boolean expression{true};
+    Boolean expression{true};
     ASSERT_FALSE(!expression);
   }
 
   TEST_F(BooleanTest, operator_and)
   {
-    ls::std::boxing::Boolean expressionA{true};
-    ls::std::boxing::Boolean expressionB{3 == 3};
+    Boolean expressionA{true};
+    Boolean expressionB{3 == 3};
 
     ASSERT_TRUE(expressionA && expressionB);
     ASSERT_TRUE(expressionB && expressionA);
@@ -84,8 +88,8 @@ namespace
 
   TEST_F(BooleanTest, operator_and_with_false_result)
   {
-    ls::std::boxing::Boolean expressionA{true};
-    ls::std::boxing::Boolean expressionB{3 == 4};
+    Boolean expressionA{true};
+    Boolean expressionB{3 == 4};
 
     ASSERT_FALSE(expressionA && expressionB);
     ASSERT_FALSE(expressionB && expressionA);
@@ -96,8 +100,8 @@ namespace
 
   TEST_F(BooleanTest, operator_or)
   {
-    ls::std::boxing::Boolean expressionA{false};
-    ls::std::boxing::Boolean expressionB{3 == 3};
+    Boolean expressionA{false};
+    Boolean expressionB{3 == 3};
 
     ASSERT_TRUE(expressionA || expressionB);
     ASSERT_TRUE(expressionB || expressionA);
@@ -108,8 +112,8 @@ namespace
 
   TEST_F(BooleanTest, operator_or_with_false_result)
   {
-    ls::std::boxing::Boolean expressionA{false};
-    ls::std::boxing::Boolean expressionB{3 == 4};
+    Boolean expressionA{false};
+    Boolean expressionB{3 == 4};
 
     ASSERT_FALSE(expressionA || expressionB);
     ASSERT_FALSE(expressionB || expressionA);
@@ -122,7 +126,7 @@ namespace
 
   TEST_F(BooleanTest, parse_true_value)
   {
-    ls::std::boxing::Boolean expression{};
+    Boolean expression{};
 
     expression.parse("true");
     ASSERT_TRUE(expression);
@@ -136,7 +140,7 @@ namespace
 
   TEST_F(BooleanTest, parse_false_value)
   {
-    ls::std::boxing::Boolean expression{};
+    Boolean expression{};
 
     expression.parse("false");
     ASSERT_FALSE(expression);
@@ -153,24 +157,24 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Boolean expression{};
+                     Boolean expression{};
                      expression.parse("hello");
-                   } catch (const ls::std::core::IllegalArgumentException &_exception)
+                   } catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(BooleanTest, toString_true)
   {
-    ls::std::boxing::Boolean expression{2 < 3};
+    Boolean expression{2 < 3};
     ASSERT_STREQ("true", expression.toString().c_str());
   }
 
   TEST_F(BooleanTest, toString_false)
   {
-    ls::std::boxing::Boolean expression{4 < 3};
+    Boolean expression{4 < 3};
     ASSERT_STREQ("false", expression.toString().c_str());
   }
 
@@ -178,35 +182,35 @@ namespace
 
   TEST_F(BooleanTest, getValue)
   {
-    ls::std::boxing::Boolean x{2 < 3};
+    Boolean x{2 < 3};
     ASSERT_TRUE(x.getValue());
   }
 
   TEST_F(BooleanTest, XOR_with_positive_result)
   {
-    ls::std::boxing::Boolean x{2 < 3};
-    ls::std::boxing::Boolean y{4 < 3};
+    Boolean x{2 < 3};
+    Boolean y{4 < 3};
 
-    ASSERT_TRUE(ls::std::boxing::Boolean::XOR(x, y));
-    ASSERT_TRUE(ls::std::boxing::Boolean::XOR(y, x));
-    ASSERT_TRUE(ls::std::boxing::Boolean::XOR(y, true));
-    ASSERT_TRUE(ls::std::boxing::Boolean::XOR(true, y));
-    ASSERT_TRUE(ls::std::boxing::Boolean::XOR(true, false));
-    ASSERT_TRUE(ls::std::boxing::Boolean::XOR(false, true));
+    ASSERT_TRUE(Boolean::XOR(x, y));
+    ASSERT_TRUE(Boolean::XOR(y, x));
+    ASSERT_TRUE(Boolean::XOR(y, true));
+    ASSERT_TRUE(Boolean::XOR(true, y));
+    ASSERT_TRUE(Boolean::XOR(true, false));
+    ASSERT_TRUE(Boolean::XOR(false, true));
   }
 
   TEST_F(BooleanTest, XOR_with_negative_result)
   {
-    ls::std::boxing::Boolean w{};
-    ls::std::boxing::Boolean x{true};
-    ls::std::boxing::Boolean y{};
-    ls::std::boxing::Boolean z{true};
-
-    ASSERT_FALSE(ls::std::boxing::Boolean::XOR(x, z));
-    ASSERT_FALSE(ls::std::boxing::Boolean::XOR(w, y));
-    ASSERT_FALSE(ls::std::boxing::Boolean::XOR(true, true));
-    ASSERT_FALSE(ls::std::boxing::Boolean::XOR(false, false));
-    ASSERT_FALSE(ls::std::boxing::Boolean::XOR(w, false));
-    ASSERT_FALSE(ls::std::boxing::Boolean::XOR(false, w));
+    Boolean w{};
+    Boolean x{true};
+    Boolean y{};
+    Boolean z{true};
+
+    ASSERT_FALSE(Boolean::XOR(x, z));
+    ASSERT_FALSE(Boolean::XOR(w, y));
+    ASSERT_FALSE(Boolean::XOR(true, true));
+    ASSERT_FALSE(Boolean::XOR(false, false));
+    ASSERT_FALSE(Boolean::XOR(w, false));
+    ASSERT_FALSE(Boolean::XOR(false, w));
   }
 }

+ 69 - 65
test/cases/boxing/DoubleTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,10 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_boxing.hpp>
 
+using namespace ls::std::boxing;
+using namespace ls::std::core;
+using namespace ::std;
+
 namespace
 {
   class DoubleTest : public ::testing::Test
@@ -32,7 +36,7 @@ namespace
 
   TEST_F(DoubleTest, operator_assignment)
   {
-    ls::std::boxing::Double x{};
+    Double x{};
     x = 44.22;
 
     ASSERT_EQ(44.22, x);
@@ -42,67 +46,67 @@ namespace
 
   TEST_F(DoubleTest, operator_negative)
   {
-    ls::std::boxing::Double x{3.25};
+    Double x{3.25};
     ASSERT_DOUBLE_EQ(-3.25, -x);
   }
 
   TEST_F(DoubleTest, operator_addition_with_reference)
   {
-    ls::std::boxing::Double x{3.1415};
-    ls::std::boxing::Double y{2.223};
-    ls::std::boxing::Double z{x + y};
+    Double x{3.1415};
+    Double y{2.223};
+    Double z{x + y};
 
     ASSERT_DOUBLE_EQ(5.3645, z);
   }
 
   TEST_F(DoubleTest, operator_addition_with_value)
   {
-    ls::std::boxing::Double x{3.1415};
+    Double x{3.1415};
     ASSERT_DOUBLE_EQ(5.3645, x + 2.223);
   }
 
   TEST_F(DoubleTest, operator_multiplication_with_reference)
   {
-    ls::std::boxing::Double x{3.14};
-    ls::std::boxing::Double y{2.22};
-    ls::std::boxing::Double z{x * y};
+    Double x{3.14};
+    Double y{2.22};
+    Double z{x * y};
 
     ASSERT_DOUBLE_EQ(6.9708, z);
   }
 
   TEST_F(DoubleTest, operator_multiplication_with_value)
   {
-    ls::std::boxing::Double x{3.14};
+    Double x{3.14};
     ASSERT_DOUBLE_EQ(6.9708, x * 2.22);
   }
 
   TEST_F(DoubleTest, operator_substraction_with_reference)
   {
-    ls::std::boxing::Double x{3.1415};
-    ls::std::boxing::Double y{2.225};
-    ls::std::boxing::Double z{x - y};
+    Double x{3.1415};
+    Double y{2.225};
+    Double z{x - y};
 
     ASSERT_DOUBLE_EQ(0.9165, z);
   }
 
   TEST_F(DoubleTest, operator_substraction_with_value)
   {
-    ls::std::boxing::Double x{3.1415};
+    Double x{3.1415};
     ASSERT_DOUBLE_EQ(0.9165, x - 2.225);
   }
 
   TEST_F(DoubleTest, operator_division_with_reference)
   {
-    ls::std::boxing::Double x{2.25};
-    ls::std::boxing::Double y{0.5};
-    ls::std::boxing::Double z{x / y};
+    Double x{2.25};
+    Double y{0.5};
+    Double z{x / y};
 
     ASSERT_DOUBLE_EQ(4.5, z);
   }
 
   TEST_F(DoubleTest, operator_division_with_value)
   {
-    ls::std::boxing::Double x{2.25};
+    Double x{2.25};
     ASSERT_DOUBLE_EQ(4.5, x / 0.5);
   }
 
@@ -110,8 +114,8 @@ namespace
 
   TEST_F(DoubleTest, operator_add_assign_with_reference)
   {
-    ls::std::boxing::Double x{2.25000000};
-    ls::std::boxing::Double y{3.14000000};
+    Double x{2.25000000};
+    Double y{3.14000000};
 
     x += y;
     ASSERT_DOUBLE_EQ(5.39000000, x);
@@ -119,7 +123,7 @@ namespace
 
   TEST_F(DoubleTest, operator_add_assign_with_value)
   {
-    ls::std::boxing::Double x{2.25000000};
+    Double x{2.25000000};
 
     x += 3.14000000;
     ASSERT_DOUBLE_EQ(5.39000000, x);
@@ -127,8 +131,8 @@ namespace
 
   TEST_F(DoubleTest, operator_sub_assign_with_reference)
   {
-    ls::std::boxing::Double x{2.25};
-    ls::std::boxing::Double y{0.04};
+    Double x{2.25};
+    Double y{0.04};
 
     x -= y;
     ASSERT_DOUBLE_EQ(2.21, x);
@@ -136,7 +140,7 @@ namespace
 
   TEST_F(DoubleTest, operator_sub_assign_with_value)
   {
-    ls::std::boxing::Double x{2.25};
+    Double x{2.25};
 
     x -= 0.04;
     ASSERT_DOUBLE_EQ(2.21, x);
@@ -144,8 +148,8 @@ namespace
 
   TEST_F(DoubleTest, operator_mul_assign_with_reference)
   {
-    ls::std::boxing::Double x{2.25000000};
-    ls::std::boxing::Double y{0.04000000};
+    Double x{2.25000000};
+    Double y{0.04000000};
 
     x *= y;
     ASSERT_DOUBLE_EQ(0.09000000, x);
@@ -153,7 +157,7 @@ namespace
 
   TEST_F(DoubleTest, operator_mul_assign_with_value)
   {
-    ls::std::boxing::Double x{2.25000000};
+    Double x{2.25000000};
 
     x *= 0.04000000;
     ASSERT_DOUBLE_EQ(0.09000000, x);
@@ -161,8 +165,8 @@ namespace
 
   TEST_F(DoubleTest, operator_division_assign_with_reference)
   {
-    ls::std::boxing::Double x{2.25};
-    ls::std::boxing::Double y{0.05};
+    Double x{2.25};
+    Double y{0.05};
 
     x /= y;
     ASSERT_DOUBLE_EQ(45.0, x);
@@ -170,7 +174,7 @@ namespace
 
   TEST_F(DoubleTest, operator_division_assign_with_value)
   {
-    ls::std::boxing::Double x{2.25};
+    Double x{2.25};
 
     x /= 0.05;
     ASSERT_DOUBLE_EQ(45.0, x);
@@ -180,8 +184,8 @@ namespace
 
   TEST_F(DoubleTest, operator_equals_with_reference)
   {
-    ls::std::boxing::Double x{3.14159};
-    ls::std::boxing::Double y{3.14159};
+    Double x{3.14159};
+    Double y{3.14159};
 
     ASSERT_TRUE(x == y);
     ASSERT_TRUE(y == x);
@@ -189,7 +193,7 @@ namespace
 
   TEST_F(DoubleTest, operator_equals_with_value)
   {
-    ls::std::boxing::Double x{3.14159};
+    Double x{3.14159};
 
     ASSERT_TRUE(x == 3.14159);
     ASSERT_TRUE(3.14159 == x);
@@ -197,8 +201,8 @@ namespace
 
   TEST_F(DoubleTest, operator_not_equal_with_reference)
   {
-    ls::std::boxing::Double x{3.1415};
-    ls::std::boxing::Double y{3.1414};
+    Double x{3.1415};
+    Double y{3.1414};
 
     ASSERT_TRUE(x != y);
     ASSERT_TRUE(y != x);
@@ -206,7 +210,7 @@ namespace
 
   TEST_F(DoubleTest, operator_not_equal_with_value)
   {
-    ls::std::boxing::Double x{3.1415};
+    Double x{3.1415};
 
     ASSERT_TRUE(x != 3.1414);
     ASSERT_TRUE(3.1414 != x);
@@ -214,25 +218,25 @@ namespace
 
   TEST_F(DoubleTest, operator_greater_than_with_reference)
   {
-    ls::std::boxing::Double x{3.1415};
-    ls::std::boxing::Double y{3.1414};
+    Double x{3.1415};
+    Double y{3.1414};
 
     ASSERT_TRUE(x > y);
   }
 
   TEST_F(DoubleTest, operator_greater_than_with_value)
   {
-    ls::std::boxing::Double x{3.1415};
-    ls::std::boxing::Double y{3.1414};
+    Double x{3.1415};
+    Double y{3.1414};
 
     ASSERT_TRUE(x > 3.1414);
   }
 
   TEST_F(DoubleTest, operator_greater_than_equals_with_reference)
   {
-    ls::std::boxing::Double x{3.1414};
-    ls::std::boxing::Double y{3.1414};
-    ls::std::boxing::Double z{3.1415};
+    Double x{3.1414};
+    Double y{3.1414};
+    Double z{3.1415};
 
     ASSERT_TRUE(x >= y);
     ASSERT_TRUE(z >= y);
@@ -240,31 +244,31 @@ namespace
 
   TEST_F(DoubleTest, operator_greater_than_equals_with_value)
   {
-    ls::std::boxing::Double x{3.1414};
+    Double x{3.1414};
     ASSERT_TRUE(x >= 3.1414);
   }
 
   TEST_F(DoubleTest, operator_less_than_with_reference)
   {
-    ls::std::boxing::Double x{3.1413};
-    ls::std::boxing::Double y{3.1414};
+    Double x{3.1413};
+    Double y{3.1414};
 
     ASSERT_TRUE(x < y);
   }
 
   TEST_F(DoubleTest, operator_less_than_with_value)
   {
-    ls::std::boxing::Double x{3.1413};
-    ls::std::boxing::Double y{3.1414};
+    Double x{3.1413};
+    Double y{3.1414};
 
     ASSERT_TRUE(x < 3.1414);
   }
 
   TEST_F(DoubleTest, operator_less_than_equals_with_reference)
   {
-    ls::std::boxing::Double x{3.1414};
-    ls::std::boxing::Double y{3.1414};
-    ls::std::boxing::Double z{3.1415};
+    Double x{3.1414};
+    Double y{3.1414};
+    Double z{3.1415};
 
     ASSERT_TRUE(x <= y);
     ASSERT_TRUE(x <= z);
@@ -272,7 +276,7 @@ namespace
 
   TEST_F(DoubleTest, operator_less_than_equals_with_value)
   {
-    ls::std::boxing::Double x{3.1414};
+    Double x{3.1414};
     ASSERT_TRUE(x <= 3.1414);
   }
 
@@ -280,7 +284,7 @@ namespace
 
   TEST_F(DoubleTest, operator_increment)
   {
-    ls::std::boxing::Double x{3.1415};
+    Double x{3.1415};
 
     ++x;
     ASSERT_DOUBLE_EQ(4.1415, x);
@@ -288,7 +292,7 @@ namespace
 
   TEST_F(DoubleTest, operator_decrement)
   {
-    ls::std::boxing::Double x{3.1415};
+    Double x{3.1415};
 
     --x;
     ASSERT_DOUBLE_EQ(2.1415, x);
@@ -298,7 +302,7 @@ namespace
 
   TEST_F(DoubleTest, parse_with_positive_value)
   {
-    ls::std::boxing::Double x{};
+    Double x{};
 
     x.parse("3.1415");
     ASSERT_DOUBLE_EQ(3.1415, x);
@@ -306,7 +310,7 @@ namespace
 
   TEST_F(DoubleTest, parse_with_negative_value)
   {
-    ls::std::boxing::Double x{};
+    Double x{};
 
     x.parse("-2.1415");
     ASSERT_DOUBLE_EQ(-2.1415, x);
@@ -314,27 +318,27 @@ namespace
 
   TEST_F(DoubleTest, toString)
   {
-    ls::std::boxing::Double x{13.1543};
-    ASSERT_TRUE(x.toString().find("13.1543") != ::std::string::npos);
+    Double x{13.1543};
+    ASSERT_TRUE(x.toString().find("13.1543") != string::npos);
   }
 
   // additional functionality
 
   TEST_F(DoubleTest, getEpsilon)
   {
-    ls::std::boxing::Double x{};
+    Double x{};
     ASSERT_DOUBLE_EQ(0.00000001, x.getEpsilon());
   }
 
   TEST_F(DoubleTest, getValue)
   {
-    ls::std::boxing::Double x{3.1415};
+    Double x{3.1415};
     ASSERT_DOUBLE_EQ(3.1415, x.getValue());
   }
 
   TEST_F(DoubleTest, setEpsilon)
   {
-    ls::std::boxing::Double x{};
+    Double x{};
     x.setEpsilon(0.01);
 
     ASSERT_DOUBLE_EQ(0.01, x.getEpsilon());
@@ -342,17 +346,17 @@ namespace
 
   TEST_F(DoubleTest, setEpsilon_invalid_value)
   {
-    ls::std::boxing::Double x{};
+    Double x{};
 
     EXPECT_THROW({
                    try
                    {
                      x.setEpsilon(0.0);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 }

+ 67 - 63
test/cases/boxing/FloatTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,10 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_boxing.hpp>
 
+using namespace ls::std::boxing;
+using namespace ls::std::core;
+using namespace ::std;
+
 namespace
 {
   class FloatTest : public ::testing::Test
@@ -31,7 +35,7 @@ namespace
 
   TEST_F(FloatTest, operator_assignment)
   {
-    ls::std::boxing::Float x{13.023f};
+    Float x{13.023f};
 
     x = 44.22f;
     ASSERT_EQ(44.22f, x);
@@ -41,67 +45,67 @@ namespace
 
   TEST_F(FloatTest, operator_negative)
   {
-    ls::std::boxing::Float x{3.25f};
+    Float x{3.25f};
     ASSERT_FLOAT_EQ(-3.25f, -x);
   }
 
   TEST_F(FloatTest, operator_addition_with_reference)
   {
-    ls::std::boxing::Float x{3.1415f};
-    ls::std::boxing::Float y{2.223f};
-    ls::std::boxing::Float z{x + y};
+    Float x{3.1415f};
+    Float y{2.223f};
+    Float z{x + y};
 
     ASSERT_FLOAT_EQ(5.3645f, z);
   }
 
   TEST_F(FloatTest, operator_addition_with_value)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     ASSERT_FLOAT_EQ(5.3645f, x + 2.223f);
   }
 
   TEST_F(FloatTest, operator_multiplication_with_reference)
   {
-    ls::std::boxing::Float x{3.14f};
-    ls::std::boxing::Float y{2.22f};
-    ls::std::boxing::Float z{x * y};
+    Float x{3.14f};
+    Float y{2.22f};
+    Float z{x * y};
 
     ASSERT_FLOAT_EQ(6.9708f, z);
   }
 
   TEST_F(FloatTest, operator_multiplication_with_value)
   {
-    ls::std::boxing::Float x{3.14f};
+    Float x{3.14f};
     ASSERT_FLOAT_EQ(6.9708f, x * 2.22f);
   }
 
   TEST_F(FloatTest, operator_substraction_with_reference)
   {
-    ls::std::boxing::Float x{3.1415f};
-    ls::std::boxing::Float y{2.225f};
-    ls::std::boxing::Float z{x - y};
+    Float x{3.1415f};
+    Float y{2.225f};
+    Float z{x - y};
 
     ASSERT_FLOAT_EQ(0.9165f, z);
   }
 
   TEST_F(FloatTest, operator_substraction_with_value)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     ASSERT_FLOAT_EQ(0.9165f, x - 2.225f);
   }
 
   TEST_F(FloatTest, operator_division_with_reference)
   {
-    ls::std::boxing::Float x{2.25f};
-    ls::std::boxing::Float y{0.5f};
-    ls::std::boxing::Float z{x / y};
+    Float x{2.25f};
+    Float y{0.5f};
+    Float z{x / y};
 
     ASSERT_FLOAT_EQ(4.5f, z);
   }
 
   TEST_F(FloatTest, operator_division_with_value)
   {
-    ls::std::boxing::Float x{2.25f};
+    Float x{2.25f};
     ASSERT_FLOAT_EQ(4.5f, x / 0.5f);
   }
 
@@ -109,8 +113,8 @@ namespace
 
   TEST_F(FloatTest, operator_add_assign_with_reference)
   {
-    ls::std::boxing::Float x{2.25f};
-    ls::std::boxing::Float y{3.14f};
+    Float x{2.25f};
+    Float y{3.14f};
     x += y;
 
     ASSERT_FLOAT_EQ(5.39f, x);
@@ -118,7 +122,7 @@ namespace
 
   TEST_F(FloatTest, operator_add_assign_with_value)
   {
-    ls::std::boxing::Float x{2.25f};
+    Float x{2.25f};
     x += 3.14f;
 
     ASSERT_FLOAT_EQ(5.39f, x);
@@ -126,8 +130,8 @@ namespace
 
   TEST_F(FloatTest, operator_sub_assign_with_reference)
   {
-    ls::std::boxing::Float x{2.25f};
-    ls::std::boxing::Float y{1.14f};
+    Float x{2.25f};
+    Float y{1.14f};
     x -= y;
 
     ASSERT_FLOAT_EQ(1.11f, x);
@@ -135,7 +139,7 @@ namespace
 
   TEST_F(FloatTest, operator_sub_assign_with_value)
   {
-    ls::std::boxing::Float x{2.25f};
+    Float x{2.25f};
     x -= 1.14f;
 
     ASSERT_FLOAT_EQ(1.11f, x);
@@ -143,8 +147,8 @@ namespace
 
   TEST_F(FloatTest, operator_mul_assign_with_reference)
   {
-    ls::std::boxing::Float x{2.25f};
-    ls::std::boxing::Float y{0.04f};
+    Float x{2.25f};
+    Float y{0.04f};
     x *= y;
 
     ASSERT_FLOAT_EQ(0.09f, x);
@@ -152,7 +156,7 @@ namespace
 
   TEST_F(FloatTest, operator_mul_assign_with_value)
   {
-    ls::std::boxing::Float x{2.25f};
+    Float x{2.25f};
     x *= 1.14f;
 
     ASSERT_FLOAT_EQ(2.565f, x);
@@ -160,8 +164,8 @@ namespace
 
   TEST_F(FloatTest, operator_division_assign_with_reference)
   {
-    ls::std::boxing::Float x{2.25f};
-    ls::std::boxing::Float y{1.5f};
+    Float x{2.25f};
+    Float y{1.5f};
     x /= y;
 
     ASSERT_FLOAT_EQ(1.5f, x);
@@ -169,7 +173,7 @@ namespace
 
   TEST_F(FloatTest, operator_division_assign_with_value)
   {
-    ls::std::boxing::Float x{2.25f};
+    Float x{2.25f};
     x /= 0.05f;
 
     ASSERT_FLOAT_EQ(45.0f, x);
@@ -179,8 +183,8 @@ namespace
 
   TEST_F(FloatTest, operator_equals_with_reference)
   {
-    ls::std::boxing::Float x{3.14159f};
-    ls::std::boxing::Float y{3.14159f};
+    Float x{3.14159f};
+    Float y{3.14159f};
 
     ASSERT_TRUE(x == y);
     ASSERT_TRUE(y == x);
@@ -188,14 +192,14 @@ namespace
 
   TEST_F(FloatTest, operator_equals_with_value)
   {
-    ls::std::boxing::Float x{3.14159f};
+    Float x{3.14159f};
     ASSERT_TRUE(x == 3.14159f);
   }
 
   TEST_F(FloatTest, operator_not_equals_with_reference)
   {
-    ls::std::boxing::Float x{3.1415f};
-    ls::std::boxing::Float y{3.1414f};
+    Float x{3.1415f};
+    Float y{3.1414f};
 
     ASSERT_TRUE(x != y);
     ASSERT_TRUE(y != x);
@@ -203,14 +207,14 @@ namespace
 
   TEST_F(FloatTest, operator_not_equals_with_value)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     ASSERT_TRUE(x != 3.1414f);
   }
 
   TEST_F(FloatTest, operator_greater_than_with_reference)
   {
-    ls::std::boxing::Float x{3.1415f};
-    ls::std::boxing::Float y{3.1414f};
+    Float x{3.1415f};
+    Float y{3.1414f};
 
     ASSERT_TRUE(x > y);
     ASSERT_TRUE(x > 3.1414f);
@@ -218,15 +222,15 @@ namespace
 
   TEST_F(FloatTest, operator_greater_than_with_value)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     ASSERT_TRUE(x > 3.1414f);
   }
 
   TEST_F(FloatTest, operator_greater_than_equals_with_reference)
   {
-    ls::std::boxing::Float x{3.1414f};
-    ls::std::boxing::Float y{3.1414f};
-    ls::std::boxing::Float z{3.1415f};
+    Float x{3.1414f};
+    Float y{3.1414f};
+    Float z{3.1415f};
 
     ASSERT_TRUE(x >= y);
     ASSERT_TRUE(z >= y);
@@ -234,8 +238,8 @@ namespace
 
   TEST_F(FloatTest, operator_greater_than_equals_with_value)
   {
-    ls::std::boxing::Float x{3.1414f};
-    ls::std::boxing::Float z{3.1415f};
+    Float x{3.1414f};
+    Float z{3.1415f};
 
     ASSERT_TRUE(x >= 3.1414f);
     ASSERT_TRUE(z >= 3.1414f);
@@ -243,23 +247,23 @@ namespace
 
   TEST_F(FloatTest, operator_less_than_with_reference)
   {
-    ls::std::boxing::Float x{3.1413f};
-    ls::std::boxing::Float y{3.1414f};
+    Float x{3.1413f};
+    Float y{3.1414f};
 
     ASSERT_TRUE(x < y);
   }
 
   TEST_F(FloatTest, operator_less_than_with_value)
   {
-    ls::std::boxing::Float x{3.1413f};
+    Float x{3.1413f};
     ASSERT_TRUE(x < 3.1414f);
   }
 
   TEST_F(FloatTest, operator_less_than_equals_with_reference)
   {
-    ls::std::boxing::Float x{3.1414f};
-    ls::std::boxing::Float y{3.1414f};
-    ls::std::boxing::Float z{3.1415f};
+    Float x{3.1414f};
+    Float y{3.1414f};
+    Float z{3.1415f};
 
     ASSERT_TRUE(x <= y);
     ASSERT_TRUE(x <= z);
@@ -267,7 +271,7 @@ namespace
 
   TEST_F(FloatTest, operator_less_than_equals_with_value)
   {
-    ls::std::boxing::Float x{3.1414f};
+    Float x{3.1414f};
 
     ASSERT_TRUE(x <= 3.1414f);
     ASSERT_TRUE(x <= 3.1415f);
@@ -277,7 +281,7 @@ namespace
 
   TEST_F(FloatTest, operator_increment)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     ++x;
 
     ASSERT_FLOAT_EQ(4.1415f, x);
@@ -285,7 +289,7 @@ namespace
 
   TEST_F(FloatTest, operator_decrement)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     --x;
 
     ASSERT_FLOAT_EQ(2.1415f, x);
@@ -295,7 +299,7 @@ namespace
 
   TEST_F(FloatTest, parse)
   {
-    ls::std::boxing::Float number{};
+    Float number{};
 
     number.parse("3.1415f");
     ASSERT_FLOAT_EQ(3.1415f, number);
@@ -303,27 +307,27 @@ namespace
 
   TEST_F(FloatTest, toString)
   {
-    ls::std::boxing::Float x{13.1543f};
-    ASSERT_TRUE(x.toString().find("13.1543") != ::std::string::npos);
+    Float x{13.1543f};
+    ASSERT_TRUE(x.toString().find("13.1543") != string::npos);
   }
 
   // additional functionality
 
   TEST_F(FloatTest, getEpsilon)
   {
-    ls::std::boxing::Float x{};
+    Float x{};
     ASSERT_FLOAT_EQ(0.00001f, x.getEpsilon());
   }
 
   TEST_F(FloatTest, getValue)
   {
-    ls::std::boxing::Float x{3.1415f};
+    Float x{3.1415f};
     ASSERT_FLOAT_EQ(3.1415f, x.getValue());
   }
 
   TEST_F(FloatTest, setEpsilon)
   {
-    ls::std::boxing::Float x{};
+    Float x{};
     x.setEpsilon(0.01f);
 
     ASSERT_FLOAT_EQ(0.01f, x.getEpsilon());
@@ -331,17 +335,17 @@ namespace
 
   TEST_F(FloatTest, setEpsilon_invalid_value)
   {
-    ls::std::boxing::Float x{};
+    Float x{};
 
     EXPECT_THROW({
                    try
                    {
                      x.setEpsilon(0.0f);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 }

+ 84 - 81
test/cases/boxing/IntegerTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-09
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,9 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_boxing.hpp>
 
+using namespace ls::std::boxing;
+using namespace ls::std::core;
+
 namespace
 {
   class IntegerTest : public ::testing::Test
@@ -31,8 +34,8 @@ namespace
 
   TEST_F(IntegerTest, operator_assignment_with_reference)
   {
-    ls::std::boxing::Integer x{};
-    ls::std::boxing::Integer y{3};
+    Integer x{};
+    Integer y{3};
     x = y;
 
     ASSERT_EQ(3, x);
@@ -40,7 +43,7 @@ namespace
 
   TEST_F(IntegerTest, operator_assignment_with_value)
   {
-    ls::std::boxing::Integer x{};
+    Integer x{};
     x = 44;
 
     ASSERT_EQ(44, x);
@@ -50,8 +53,8 @@ namespace
 
   TEST_F(IntegerTest, operator_negative)
   {
-    ls::std::boxing::Integer x{13};
-    ls::std::boxing::Integer y{-13};
+    Integer x{13};
+    Integer y{-13};
 
     ASSERT_EQ(-13, -x);
     ASSERT_EQ(13, -y);
@@ -59,57 +62,57 @@ namespace
 
   TEST_F(IntegerTest, operator_add_with_reference)
   {
-    ls::std::boxing::Integer x{13};
-    ls::std::boxing::Integer y{7};
+    Integer x{13};
+    Integer y{7};
 
     ASSERT_EQ(20, x + y);
   }
 
   TEST_F(IntegerTest, operator_add_with_value)
   {
-    ls::std::boxing::Integer x{13};
+    Integer x{13};
     ASSERT_EQ(20, x + 7);
   }
 
   TEST_F(IntegerTest, operator_mul_with_reference)
   {
-    ls::std::boxing::Integer x{3};
-    ls::std::boxing::Integer y{7};
+    Integer x{3};
+    Integer y{7};
 
     ASSERT_EQ(21, x * y);
   }
 
   TEST_F(IntegerTest, operator_mul_with_value)
   {
-    ls::std::boxing::Integer x{3};
+    Integer x{3};
     ASSERT_EQ(21, x * 7);
   }
 
   TEST_F(IntegerTest, operator_sub_with_reference)
   {
-    ls::std::boxing::Integer x{51};
-    ls::std::boxing::Integer y{17};
+    Integer x{51};
+    Integer y{17};
 
     ASSERT_EQ(34, x - y);
   }
 
   TEST_F(IntegerTest, operator_sub_with_value)
   {
-    ls::std::boxing::Integer x{51};
+    Integer x{51};
     ASSERT_EQ(34, x - 17);
   }
 
   TEST_F(IntegerTest, operator_div_with_reference)
   {
-    ls::std::boxing::Integer x{81};
-    ls::std::boxing::Integer y{9};
+    Integer x{81};
+    Integer y{9};
 
     ASSERT_EQ(9, x / y);
   }
 
   TEST_F(IntegerTest, operator_div_with_value)
   {
-    ls::std::boxing::Integer x{81};
+    Integer x{81};
     ASSERT_EQ(9, x / 9);
   }
 
@@ -118,15 +121,15 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Integer x{9};
-                     ls::std::boxing::Integer y{0};
+                     Integer x{9};
+                     Integer y{0};
 
                      x = x / y;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   TEST_F(IntegerTest, operator_div_by_zero_with_value)
@@ -134,26 +137,26 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Integer x{9};
+                     Integer x{9};
                      x = x / 0;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   TEST_F(IntegerTest, operator_mod_with_reference)
   {
-    ls::std::boxing::Integer x{85};
-    ls::std::boxing::Integer y{9};
+    Integer x{85};
+    Integer y{9};
 
     ASSERT_EQ(4, x % y);
   }
 
   TEST_F(IntegerTest, operator_mod_with_value)
   {
-    ls::std::boxing::Integer x{85};
+    Integer x{85};
     ASSERT_EQ(4, x % 9);
   }
 
@@ -161,8 +164,8 @@ namespace
 
   TEST_F(IntegerTest, operator_add_assign_with_reference)
   {
-    ls::std::boxing::Integer x{4};
-    ls::std::boxing::Integer y{2};
+    Integer x{4};
+    Integer y{2};
     x += y;
 
     ASSERT_EQ(6, x);
@@ -170,7 +173,7 @@ namespace
 
   TEST_F(IntegerTest, operator_add_assign_with_value)
   {
-    ls::std::boxing::Integer x{4};
+    Integer x{4};
     x += 2;
 
     ASSERT_EQ(6, x);
@@ -178,8 +181,8 @@ namespace
 
   TEST_F(IntegerTest, operator_sub_assign_with_reference)
   {
-    ls::std::boxing::Integer x{14};
-    ls::std::boxing::Integer y{2};
+    Integer x{14};
+    Integer y{2};
     x -= y;
 
     ASSERT_EQ(12, x);
@@ -187,7 +190,7 @@ namespace
 
   TEST_F(IntegerTest, operator_sub_assign_with_value)
   {
-    ls::std::boxing::Integer x{14};
+    Integer x{14};
     x -= 2;
 
     ASSERT_EQ(12, x);
@@ -195,8 +198,8 @@ namespace
 
   TEST_F(IntegerTest, operator_mul_assign_with_reference)
   {
-    ls::std::boxing::Integer x{6};
-    ls::std::boxing::Integer y{3};
+    Integer x{6};
+    Integer y{3};
     x *= y;
 
     ASSERT_EQ(18, x);
@@ -204,7 +207,7 @@ namespace
 
   TEST_F(IntegerTest, operator_mul_assign_with_value)
   {
-    ls::std::boxing::Integer x{6};
+    Integer x{6};
     x *= 3;
 
     ASSERT_EQ(18, x);
@@ -212,8 +215,8 @@ namespace
 
   TEST_F(IntegerTest, operator_div_assign_with_reference)
   {
-    ls::std::boxing::Integer x{12};
-    ls::std::boxing::Integer y{3};
+    Integer x{12};
+    Integer y{3};
     x /= y;
 
     ASSERT_EQ(4, x);
@@ -221,7 +224,7 @@ namespace
 
   TEST_F(IntegerTest, operator_div_assign_with_value)
   {
-    ls::std::boxing::Integer x{12};
+    Integer x{12};
     x /= 3;
 
     ASSERT_EQ(4, x);
@@ -232,15 +235,15 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Integer x{9};
-                     ls::std::boxing::Integer y{0};
+                     Integer x{9};
+                     Integer y{0};
 
                      x = x /= y;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   TEST_F(IntegerTest, operator_div_assign_by_zero_with_value)
@@ -248,99 +251,99 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Integer x{9};
+                     Integer x{9};
                      x = x /= 0;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   // comparison operators
 
   TEST_F(IntegerTest, operator_equals_with_reference)
   {
-    ls::std::boxing::Integer x{12};
-    ls::std::boxing::Integer y{12};
+    Integer x{12};
+    Integer y{12};
 
     ASSERT_TRUE(x == y);
   }
 
   TEST_F(IntegerTest, operator_equals_with_value)
   {
-    ls::std::boxing::Integer x{12};
+    Integer x{12};
 
     ASSERT_TRUE(x == 12);
   }
 
   TEST_F(IntegerTest, operator_not_equals_with_reference)
   {
-    ls::std::boxing::Integer x{12};
-    ls::std::boxing::Integer y{3};
+    Integer x{12};
+    Integer y{3};
 
     ASSERT_TRUE(x != y);
   }
 
   TEST_F(IntegerTest, operator_not_equals_with_value)
   {
-    ls::std::boxing::Integer x{12};
+    Integer x{12};
     ASSERT_TRUE(x != 3);
   }
 
   TEST_F(IntegerTest, operator_greater_than_with_reference)
   {
-    ls::std::boxing::Integer x{12};
-    ls::std::boxing::Integer y{3};
+    Integer x{12};
+    Integer y{3};
 
     ASSERT_TRUE(x > y);
   }
 
   TEST_F(IntegerTest, operator_greater_than_with_value)
   {
-    ls::std::boxing::Integer x{12};
+    Integer x{12};
     ASSERT_TRUE(x > 3);
   }
 
   TEST_F(IntegerTest, operator_greater_than_equals_with_reference)
   {
-    ls::std::boxing::Integer x{12};
-    ls::std::boxing::Integer y{12};
+    Integer x{12};
+    Integer y{12};
 
     ASSERT_TRUE(x >= y);
   }
 
   TEST_F(IntegerTest, operator_greater_than_equals_with_value)
   {
-    ls::std::boxing::Integer x{12};
+    Integer x{12};
     ASSERT_TRUE(x >= 12);
   }
 
   TEST_F(IntegerTest, operator_less_than_with_reference)
   {
-    ls::std::boxing::Integer x{10};
-    ls::std::boxing::Integer y{12};
+    Integer x{10};
+    Integer y{12};
 
     ASSERT_TRUE(x < y);
   }
 
   TEST_F(IntegerTest, operator_less_than_with_value)
   {
-    ls::std::boxing::Integer x{10};
+    Integer x{10};
     ASSERT_TRUE(x < 12);
   }
 
   TEST_F(IntegerTest, operator_less_than_equals_with_reference)
   {
-    ls::std::boxing::Integer x{10};
-    ls::std::boxing::Integer y{10};
+    Integer x{10};
+    Integer y{10};
 
     ASSERT_TRUE(x <= y);
   }
 
   TEST_F(IntegerTest, operator_less_than_equals_with_value)
   {
-    ls::std::boxing::Integer x{10};
+    Integer x{10};
     ASSERT_TRUE(x <= 10);
   }
 
@@ -348,47 +351,47 @@ namespace
 
   TEST_F(IntegerTest, operator_negation)
   {
-    ls::std::boxing::Integer x{};
+    Integer x{};
     ASSERT_TRUE(!x);
   }
 
   TEST_F(IntegerTest, operator_and_with_reference)
   {
-    ls::std::boxing::Integer x{1};
-    ls::std::boxing::Integer y{1};
+    Integer x{1};
+    Integer y{1};
 
     ASSERT_TRUE(x && y);
   }
 
   TEST_F(IntegerTest, operator_and_with_value)
   {
-    ls::std::boxing::Integer x{1};
+    Integer x{1};
     ASSERT_TRUE(x && 1);
   }
 
   TEST_F(IntegerTest, operator_and_with_boolean)
   {
-    ls::std::boxing::Integer x{1};
+    Integer x{1};
     ASSERT_TRUE(x && true);
   }
 
   TEST_F(IntegerTest, operator_or_with_reference)
   {
-    ls::std::boxing::Integer x{};
-    ls::std::boxing::Integer y{1};
+    Integer x{};
+    Integer y{1};
 
     ASSERT_TRUE(x || y);
   }
 
   TEST_F(IntegerTest, operator_or_with_value)
   {
-    ls::std::boxing::Integer x{};
+    Integer x{};
     ASSERT_TRUE(x || 1);
   }
 
   TEST_F(IntegerTest, operator_or_with_boolean)
   {
-    ls::std::boxing::Integer x{};
+    Integer x{};
     ASSERT_TRUE(x || true);
   }
 
@@ -396,7 +399,7 @@ namespace
 
   TEST_F(IntegerTest, operator_increment)
   {
-    ls::std::boxing::Integer x{};
+    Integer x{};
     ++x;
 
     ASSERT_EQ(1, x);
@@ -404,7 +407,7 @@ namespace
 
   TEST_F(IntegerTest, operator_decrement)
   {
-    ls::std::boxing::Integer x{};
+    Integer x{};
 
     --x;
     ASSERT_EQ(-1, x);
@@ -414,7 +417,7 @@ namespace
 
   TEST_F(IntegerTest, parse_with_positive_value)
   {
-    ls::std::boxing::Integer number{};
+    Integer number{};
 
     number.parse("1989");
     ASSERT_EQ(1989, number);
@@ -422,7 +425,7 @@ namespace
 
   TEST_F(IntegerTest, parse_with_negative_value)
   {
-    ls::std::boxing::Integer number{};
+    Integer number{};
 
     number.parse("-13");
     ASSERT_EQ(-13, number);
@@ -430,7 +433,7 @@ namespace
 
   TEST_F(IntegerTest, toString)
   {
-    ls::std::boxing::Integer number{112};
+    Integer number{112};
     ASSERT_STREQ("112", number.toString().c_str());
   }
 
@@ -438,7 +441,7 @@ namespace
 
   TEST_F(IntegerTest, getValue)
   {
-    ls::std::boxing::Integer x{3};
+    Integer x{3};
     ASSERT_EQ(3, x.getValue());
   }
 
@@ -446,7 +449,7 @@ namespace
 
   TEST_F(IntegerTest, constApproach)
   {
-    const ls::std::boxing::Integer x{3};
+    const Integer x{3};
     ASSERT_EQ(3, x);
 
     // x = 4; // wouldn't work

+ 105 - 102
test/cases/boxing/LongTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,9 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_boxing.hpp>
 
+using namespace ls::std::boxing;
+using namespace ls::std::core;
+
 namespace
 {
   class LongTest : public ::testing::Test
@@ -32,8 +35,8 @@ namespace
 
   TEST_F(LongTest, operator_assignment_with_reference)
   {
-    ls::std::boxing::Long x{13};
-    ls::std::boxing::Long y{3};
+    Long x{13};
+    Long y{3};
     x = y;
 
     ASSERT_EQ(3, x);
@@ -41,8 +44,8 @@ namespace
 
   TEST_F(LongTest, operator_assignment_with_value)
   {
-    ls::std::boxing::Long x{13};
-    x = (ls::std::core::type::long_type) 3;
+    Long x{13};
+    x = (type::long_type) 3;
 
     ASSERT_EQ(3, x);
   }
@@ -51,8 +54,8 @@ namespace
 
   TEST_F(LongTest, operator_negative)
   {
-    ls::std::boxing::Long x{13};
-    ls::std::boxing::Long y{-13};
+    Long x{13};
+    Long y{-13};
 
     ASSERT_EQ(-13, -x);
     ASSERT_EQ(13, -y);
@@ -60,58 +63,58 @@ namespace
 
   TEST_F(LongTest, operator_add_with_reference)
   {
-    ls::std::boxing::Long x{13};
-    ls::std::boxing::Long y{7};
+    Long x{13};
+    Long y{7};
 
     ASSERT_EQ(20, x + y);
   }
 
   TEST_F(LongTest, operator_add_with_value)
   {
-    ls::std::boxing::Long x{13};
-    ASSERT_EQ(20, x + (ls::std::core::type::long_type) 7);
+    Long x{13};
+    ASSERT_EQ(20, x + (type::long_type) 7);
   }
 
   TEST_F(LongTest, operator_mul_with_reference)
   {
-    ls::std::boxing::Long x{3};
-    ls::std::boxing::Long y{7};
+    Long x{3};
+    Long y{7};
 
     ASSERT_EQ(21, x * y);
   }
 
   TEST_F(LongTest, operator_mul_with_value)
   {
-    ls::std::boxing::Long x{3};
-    ASSERT_EQ(21, x * (ls::std::core::type::long_type) 7);
+    Long x{3};
+    ASSERT_EQ(21, x * (type::long_type) 7);
   }
 
   TEST_F(LongTest, operator_sub_with_reference)
   {
-    ls::std::boxing::Long x{51};
-    ls::std::boxing::Long y{17};
+    Long x{51};
+    Long y{17};
 
     ASSERT_EQ(34, x - y);
   }
 
   TEST_F(LongTest, operator_sub_with_value)
   {
-    ls::std::boxing::Long x{51};
-    ASSERT_EQ(34, x - (ls::std::core::type::long_type) 17);
+    Long x{51};
+    ASSERT_EQ(34, x - (type::long_type) 17);
   }
 
   TEST_F(LongTest, operator_div_with_reference)
   {
-    ls::std::boxing::Long x{81};
-    ls::std::boxing::Long y{9};
+    Long x{81};
+    Long y{9};
 
     ASSERT_EQ(9, x / y);
   }
 
   TEST_F(LongTest, operator_div_with_value)
   {
-    ls::std::boxing::Long x{81};
-    ASSERT_EQ(9, x / (ls::std::core::type::long_type) 9);
+    Long x{81};
+    ASSERT_EQ(9, x / (type::long_type) 9);
   }
 
   TEST_F(LongTest, operator_div_by_zero_with_reference)
@@ -119,15 +122,15 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Long x{9};
-                     ls::std::boxing::Long y{0};
+                     Long x{9};
+                     Long y{0};
 
                      x = x / y;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   TEST_F(LongTest, operator_div_by_zero_with_value)
@@ -135,35 +138,35 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Long x{9};
-                     x = x / (ls::std::core::type::long_type) 0;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                     Long x{9};
+                     x = x / (type::long_type) 0;
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   TEST_F(LongTest, operator_mod_with_reference)
   {
-    ls::std::boxing::Long x{85};
-    ls::std::boxing::Long y{9};
+    Long x{85};
+    Long y{9};
 
     ASSERT_EQ(4, x % y);
   }
 
   TEST_F(LongTest, operator_mod_with_value)
   {
-    ls::std::boxing::Long x{85};
-    ASSERT_EQ(4, x % (ls::std::core::type::long_type) 9);
+    Long x{85};
+    ASSERT_EQ(4, x % (type::long_type) 9);
   }
 
   // compound operators
 
   TEST_F(LongTest, operator_add_equals_with_reference)
   {
-    ls::std::boxing::Long x{4};
-    ls::std::boxing::Long y{2};
+    Long x{4};
+    Long y{2};
     x += y;
 
     ASSERT_EQ(6, x);
@@ -171,16 +174,16 @@ namespace
 
   TEST_F(LongTest, operator_add_equals_with_value)
   {
-    ls::std::boxing::Long x{4};
-    x += (ls::std::core::type::long_type) 2;
+    Long x{4};
+    x += (type::long_type) 2;
 
     ASSERT_EQ(6, x);
   }
 
   TEST_F(LongTest, operator_sub_equals_with_reference)
   {
-    ls::std::boxing::Long x{14};
-    ls::std::boxing::Long y{2};
+    Long x{14};
+    Long y{2};
     x -= y;
 
     ASSERT_EQ(12, x);
@@ -188,16 +191,16 @@ namespace
 
   TEST_F(LongTest, operator_sub_equals_with_value)
   {
-    ls::std::boxing::Long x{14};
-    x -= (ls::std::core::type::long_type) 2;
+    Long x{14};
+    x -= (type::long_type) 2;
 
     ASSERT_EQ(12, x);
   }
 
   TEST_F(LongTest, operator_mul_equals_with_reference)
   {
-    ls::std::boxing::Long x{6};
-    ls::std::boxing::Long y{3};
+    Long x{6};
+    Long y{3};
     x *= y;
 
     ASSERT_EQ(18, x);
@@ -205,16 +208,16 @@ namespace
 
   TEST_F(LongTest, operator_mul_equals_with_value)
   {
-    ls::std::boxing::Long x{6};
-    x *= (ls::std::core::type::long_type) 3;
+    Long x{6};
+    x *= (type::long_type) 3;
 
     ASSERT_EQ(18, x);
   }
 
   TEST_F(LongTest, operator_div_equals_with_reference)
   {
-    ls::std::boxing::Long x{12};
-    ls::std::boxing::Long y{3};
+    Long x{12};
+    Long y{3};
     x /= y;
 
     ASSERT_EQ(4, x);
@@ -222,8 +225,8 @@ namespace
 
   TEST_F(LongTest, operator_div_equals_with_value)
   {
-    ls::std::boxing::Long x{12};
-    x /= (ls::std::core::type::long_type) 3;
+    Long x{12};
+    x /= (type::long_type) 3;
 
     ASSERT_EQ(4, x);
   }
@@ -233,15 +236,15 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Long x{9};
-                     ls::std::boxing::Long y{0};
+                     Long x{9};
+                     Long y{0};
 
                      x = x /= y;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   TEST_F(LongTest, operator_div_equals_by_zero_with_value)
@@ -249,148 +252,148 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::boxing::Long x{9};
-                     x = x /= (ls::std::core::type::long_type) 0;
-                   } catch (const ls::std::core::IllegalArithmeticOperationException &_exception)
+                     Long x{9};
+                     x = x /= (type::long_type) 0;
+                   } catch (const IllegalArithmeticOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArithmeticOperationException);
+                 }, IllegalArithmeticOperationException);
   }
 
   // comparison operators
 
   TEST_F(LongTest, operator_equals_with_reference)
   {
-    ls::std::boxing::Long x{12};
-    ls::std::boxing::Long y{12};
+    Long x{12};
+    Long y{12};
 
     ASSERT_TRUE(x == y);
   }
 
   TEST_F(LongTest, operator_equals_with_value)
   {
-    ls::std::boxing::Long x{12};
-    ASSERT_TRUE(x == (ls::std::core::type::long_type) 12);
+    Long x{12};
+    ASSERT_TRUE(x == (type::long_type) 12);
   }
 
   TEST_F(LongTest, operator_not_equals_with_reference)
   {
-    ls::std::boxing::Long x{12};
-    ls::std::boxing::Long y{3};
+    Long x{12};
+    Long y{3};
 
     ASSERT_TRUE(x != y);
   }
 
   TEST_F(LongTest, operator_not_equals_with_value)
   {
-    ls::std::boxing::Long x{12};
-    ASSERT_TRUE(x != (ls::std::core::type::long_type) 3);
+    Long x{12};
+    ASSERT_TRUE(x != (type::long_type) 3);
   }
 
   TEST_F(LongTest, operator_greater_than_with_reference)
   {
-    ls::std::boxing::Long x{12};
-    ls::std::boxing::Long y{3};
+    Long x{12};
+    Long y{3};
 
     ASSERT_TRUE(x > y);
   }
 
   TEST_F(LongTest, operator_greater_than_with_value)
   {
-    ls::std::boxing::Long x{12};
-    ASSERT_TRUE(x > (ls::std::core::type::long_type) 3);
+    Long x{12};
+    ASSERT_TRUE(x > (type::long_type) 3);
   }
 
   TEST_F(LongTest, operator_greater_than_equals_with_reference)
   {
-    ls::std::boxing::Long x{12};
-    ls::std::boxing::Long y{12};
+    Long x{12};
+    Long y{12};
 
     ASSERT_TRUE(x >= y);
   }
 
   TEST_F(LongTest, operator_greater_than_equals_with_value)
   {
-    ls::std::boxing::Long x{12};
-    ASSERT_TRUE(x >= (ls::std::core::type::long_type) 12);
+    Long x{12};
+    ASSERT_TRUE(x >= (type::long_type) 12);
   }
 
   TEST_F(LongTest, operator_less_than_with_reference)
   {
-    ls::std::boxing::Long x{10};
-    ls::std::boxing::Long y{12};
+    Long x{10};
+    Long y{12};
 
     ASSERT_TRUE(x < y);
   }
 
   TEST_F(LongTest, operator_less_than_with_value)
   {
-    ls::std::boxing::Long x{10};
-    ls::std::boxing::Long y{12};
+    Long x{10};
+    Long y{12};
 
-    ASSERT_TRUE(x < (ls::std::core::type::long_type) 12);
+    ASSERT_TRUE(x < (type::long_type) 12);
   }
 
   TEST_F(LongTest, operator_less_than_equals_with_reference)
   {
-    ls::std::boxing::Long x{10};
-    ls::std::boxing::Long y{10};
+    Long x{10};
+    Long y{10};
 
     ASSERT_TRUE(x <= y);
   }
 
   TEST_F(LongTest, operator_less_than_equals_with_value)
   {
-    ls::std::boxing::Long x{10};
-    ASSERT_TRUE(x <= (ls::std::core::type::long_type) 10);
+    Long x{10};
+    ASSERT_TRUE(x <= (type::long_type) 10);
   }
 
   // logical operators
 
   TEST_F(LongTest, operator_negation)
   {
-    ls::std::boxing::Long x{};
+    Long x{};
     ASSERT_TRUE(!x);
   }
 
   TEST_F(LongTest, operator_and_with_reference)
   {
-    ls::std::boxing::Long x{1};
-    ls::std::boxing::Long y{1};
+    Long x{1};
+    Long y{1};
 
     ASSERT_TRUE(x && y);
   }
 
   TEST_F(LongTest, operator_and_with_value)
   {
-    ls::std::boxing::Long x{1};
-    ASSERT_TRUE(x && (ls::std::core::type::long_type) 1);
+    Long x{1};
+    ASSERT_TRUE(x && (type::long_type) 1);
   }
 
   TEST_F(LongTest, operator_and_with_boolean)
   {
-    ls::std::boxing::Long x{1};
+    Long x{1};
     ASSERT_TRUE(x && true);
   }
 
   TEST_F(LongTest, operator_or_with_reference)
   {
-    ls::std::boxing::Long x{};
-    ls::std::boxing::Long y{1};
+    Long x{};
+    Long y{1};
 
     ASSERT_TRUE(x || y);
   }
 
   TEST_F(LongTest, operator_or_with_value)
   {
-    ls::std::boxing::Long x{};
-    ASSERT_TRUE(x || (ls::std::core::type::long_type) 1);
+    Long x{};
+    ASSERT_TRUE(x || (type::long_type) 1);
   }
 
   TEST_F(LongTest, operator_or_with_boolean)
   {
-    ls::std::boxing::Long x{};
+    Long x{};
     ASSERT_TRUE(x || true);
   }
 
@@ -398,7 +401,7 @@ namespace
 
   TEST_F(LongTest, operator_increment)
   {
-    ls::std::boxing::Long x{};
+    Long x{};
     ++x;
 
     ASSERT_EQ(1, x);
@@ -406,7 +409,7 @@ namespace
 
   TEST_F(LongTest, operator_decrement)
   {
-    ls::std::boxing::Long x{};
+    Long x{};
     --x;
 
     ASSERT_EQ(-1, x);
@@ -416,7 +419,7 @@ namespace
 
   TEST_F(LongTest, parse_with_positive_value)
   {
-    ls::std::boxing::Long x{};
+    Long x{};
 
     x.parse("1989");
     ASSERT_EQ(1989, x);
@@ -424,7 +427,7 @@ namespace
 
   TEST_F(LongTest, parse_with_negative_value)
   {
-    ls::std::boxing::Long x{};
+    Long x{};
 
     x.parse("-17");
     ASSERT_EQ(-17, x);
@@ -432,7 +435,7 @@ namespace
 
   TEST_F(LongTest, toString)
   {
-    ls::std::boxing::Long x{112};
+    Long x{112};
     ASSERT_STREQ("112", x.toString().c_str());
   }
 
@@ -440,7 +443,7 @@ namespace
 
   TEST_F(LongTest, getValue)
   {
-    ls::std::boxing::Long x{3};
+    Long x{3};
     ASSERT_EQ(3, x.getValue());
   }
 
@@ -448,7 +451,7 @@ namespace
 
   TEST_F(LongTest, constApproach)
   {
-    const ls::std::boxing::Long x{3};
+    const Long x{3};
     ASSERT_EQ(3, x);
 
     // x = 4; // wouldn't work

+ 40 - 37
test/cases/boxing/StringTest.cpp

@@ -3,13 +3,16 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-14
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std_boxing.hpp>
 
+using namespace ls::std::boxing;
+using namespace ::std;
+
 namespace
 {
   class StringTest : public ::testing::Test
@@ -30,7 +33,7 @@ namespace
 
   TEST_F(StringTest, operator_assignment)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "Hi!";
 
     ASSERT_STREQ("Hi!", text.toString().c_str());
@@ -40,9 +43,9 @@ namespace
 
   TEST_F(StringTest, operator_add)
   {
-    ls::std::boxing::String greetings{"Hello! "};
-    ls::std::boxing::String question{"How are you? "};
-    const ::std::string& answer = "I'm good by the way!";
+    String greetings{"Hello! "};
+    String question{"How are you? "};
+    const string& answer = "I'm good by the way!";
 
     greetings = greetings + question + answer;
 
@@ -51,7 +54,7 @@ namespace
 
   TEST_F(StringTest, operator_minus)
   {
-    ls::std::boxing::String text{"abcdefghij"};
+    String text{"abcdefghij"};
     text = text - 5;
 
     ASSERT_STREQ("abcde", text.toString().c_str());
@@ -61,8 +64,8 @@ namespace
 
   TEST_F(StringTest, operator_add_assign_with_reference)
   {
-    ls::std::boxing::String text{};
-    ls::std::boxing::String hello{"Hi!"};
+    String text{};
+    String hello{"Hi!"};
 
     text += hello;
     ASSERT_STREQ("Hi!", text.toString().c_str());
@@ -70,7 +73,7 @@ namespace
 
   TEST_F(StringTest, operator_add_assign_with_value)
   {
-    ls::std::boxing::String text{};
+    String text{};
 
     text += "Hi!";
     ASSERT_STREQ("Hi!", text.toString().c_str());
@@ -80,8 +83,8 @@ namespace
 
   TEST_F(StringTest, operator_equals_with_reference)
   {
-    ls::std::boxing::String text{"Hi!"};
-    ls::std::boxing::String hello{"Hi!"};
+    String text{"Hi!"};
+    String hello{"Hi!"};
 
     ASSERT_TRUE(text == hello);
     ASSERT_TRUE(hello == text);
@@ -89,21 +92,21 @@ namespace
 
   TEST_F(StringTest, operator_equals_with_value)
   {
-    ls::std::boxing::String hello{"Hi!"};
+    String hello{"Hi!"};
     ASSERT_TRUE(hello == "Hi!");
   }
 
   TEST_F(StringTest, operator_not_equals_with_reference)
   {
-    ls::std::boxing::String text{"Hi!"};
-    ls::std::boxing::String hello{"Hello!"};
+    String text{"Hi!"};
+    String hello{"Hello!"};
 
     ASSERT_TRUE(text != hello);
   }
 
   TEST_F(StringTest, operator_not_equals_with_value)
   {
-    ls::std::boxing::String text{"Hi!"};
+    String text{"Hi!"};
     ASSERT_TRUE(text != "Hello!");
   }
 
@@ -111,7 +114,7 @@ namespace
 
   TEST_F(StringTest, parse)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text.parse("Hello!");
 
     ASSERT_STREQ("Hello!", text.toString().c_str());
@@ -119,7 +122,7 @@ namespace
 
   TEST_F(StringTest, toString)
   {
-    ls::std::boxing::String text{"Hello!"};
+    String text{"Hello!"};
     ASSERT_STREQ("Hello!", text.toString().c_str());
   }
 
@@ -127,7 +130,7 @@ namespace
 
   TEST_F(StringTest, contains)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "Hey, I'm searching for the keyword 'cake'!";
 
     ASSERT_TRUE(text.contains("cake"));
@@ -135,7 +138,7 @@ namespace
 
   TEST_F(StringTest, contains_does_not_contain_search_word)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "Hey, I'm searching for the keyword 'cake'!";
 
     ASSERT_FALSE(text.contains("butter"));
@@ -143,7 +146,7 @@ namespace
 
   TEST_F(StringTest, endsWith)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "abcdef";
 
     ASSERT_TRUE(text.endsWith("ef"));
@@ -151,7 +154,7 @@ namespace
 
   TEST_F(StringTest, endsWith_does_not_end_with_pattern)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "abcdef";
 
     ASSERT_FALSE(text.endsWith("efg"));
@@ -159,8 +162,8 @@ namespace
 
   TEST_F(StringTest, equalsIgnoreCase)
   {
-    ls::std::boxing::String text{"Hello!"};
-    ls::std::boxing::String hello{"HeLLo!"};
+    String text{"Hello!"};
+    String hello{"HeLLo!"};
 
     ASSERT_TRUE(text.equalsIgnoreCase(hello));
     ASSERT_TRUE(text.equalsIgnoreCase("HeLLO!"));
@@ -168,16 +171,16 @@ namespace
 
   TEST_F(StringTest, getByteData)
   {
-    ls::std::boxing::String text{"Hallo!"};
+    String text{"Hallo!"};
     ASSERT_STREQ("Hallo!", text.getByteData().data());
   }
 
   TEST_F(StringTest, padLeft)
   {
-    ls::std::boxing::String text{"abcdef"};
-    ls::std::boxing::String anotherText{"ab"};
-    ls::std::boxing::String emptyText{};
-    ls::std::boxing::String longText{"This text is too long to fill!"};
+    String text{"abcdef"};
+    String anotherText{"ab"};
+    String emptyText{};
+    String longText{"This text is too long to fill!"};
 
     ASSERT_STREQ("    abcdef", text.padLeft(10, ' ').c_str());
     ASSERT_STREQ("        ab", anotherText.padLeft(10, ' ').c_str());
@@ -187,10 +190,10 @@ namespace
 
   TEST_F(StringTest, padRight)
   {
-    ls::std::boxing::String text{"abcdef"};
-    ls::std::boxing::String anotherText{"ab"};
-    ls::std::boxing::String emptyText{};
-    ls::std::boxing::String longText{"This text is too long to fill!"};
+    String text{"abcdef"};
+    String anotherText{"ab"};
+    String emptyText{};
+    String longText{"This text is too long to fill!"};
 
     ASSERT_STREQ("abcdef    ", text.padRight(10, ' ').c_str());
     ASSERT_STREQ("ab        ", anotherText.padRight(10, ' ').c_str());
@@ -200,7 +203,7 @@ namespace
 
   TEST_F(StringTest, reverse)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "abcdef";
 
     ASSERT_STREQ("fedcba", text.reverse().c_str());
@@ -209,7 +212,7 @@ namespace
 
   TEST_F(StringTest, startsWith)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "abcdef";
 
     ASSERT_TRUE(text.startsWith("abc"));
@@ -217,7 +220,7 @@ namespace
 
   TEST_F(StringTest, startsWith_does_not_start_with_pattern)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "abcdef";
 
     ASSERT_FALSE(text.startsWith("bc"));
@@ -225,7 +228,7 @@ namespace
 
   TEST_F(StringTest, toLowerCase)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "aBCdeFgHIJKLmn";
 
     ASSERT_STREQ("abcdefghijklmn", text.toLowerCase().c_str());
@@ -234,7 +237,7 @@ namespace
 
   TEST_F(StringTest, toUpperCase)
   {
-    ls::std::boxing::String text{};
+    String text{};
     text = "aBCdeFgHIJKLmn";
 
     ASSERT_STREQ("ABCDEFGHIJKLMN", text.toUpperCase().c_str());