Enable assert always in Dali::Vector
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Vector.cpp
index 7616cc0..815cf69 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
  *
  */
 
-#define ENABLE_VECTOR_ASSERTS
-
 #include <dali-test-suite-utils.h>
 #include <dali/public-api/dali-core.h>
 #include <stdlib.h>
@@ -1400,7 +1398,6 @@ int UtcDaliVectorEraseFreeFunction(void)
   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
 
-
   vector.PushBack(1);
   vector.PushBack(2);
   vector.PushBack(3);
@@ -1417,7 +1414,6 @@ int UtcDaliVectorEraseFreeFunction(void)
   DALI_TEST_EQUALS(vector[2], 4, TEST_LOCATION);
   DALI_TEST_EQUALS(vector[3], 5, TEST_LOCATION);
 
-
   // erase an element present at start
   Dali::Erase(vector, 1);
   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
@@ -1447,11 +1443,10 @@ int UtcDaliVectorEraseIfFreeFunction(void)
   Vector<int> vector;
 
   // erasing from empty vector
-  Dali::EraseIf(vector, [](const auto & value) {return value == 2;});
+  Dali::EraseIf(vector, [](const auto& value) { return value == 2; });
   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
 
-
   vector.PushBack(1);
   vector.PushBack(2);
   vector.PushBack(3);
@@ -1460,7 +1455,7 @@ int UtcDaliVectorEraseIfFreeFunction(void)
   vector.PushBack(3);
 
   // erase multiple value
-  Dali::EraseIf(vector, [](const auto & value) {return value == 3;});
+  Dali::EraseIf(vector, [](const auto& value) { return value == 3; });
   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
 
   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
@@ -1468,22 +1463,21 @@ int UtcDaliVectorEraseIfFreeFunction(void)
   DALI_TEST_EQUALS(vector[2], 4, TEST_LOCATION);
   DALI_TEST_EQUALS(vector[3], 5, TEST_LOCATION);
 
-
   // erase an element present at start
-  Dali::EraseIf(vector, [](const auto & value) {return value == 1;});
+  Dali::EraseIf(vector, [](const auto& value) { return value == 1; });
   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
   DALI_TEST_EQUALS(vector[2], 5, TEST_LOCATION);
 
   // erase an element present at end
-  Dali::EraseIf(vector, [](const auto & value) {return value == 5;});
+  Dali::EraseIf(vector, [](const auto& value) { return value == 5; });
   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
 
   // erase an element not present in the vector
-  Dali::EraseIf(vector, [](const auto & value) {return value == 42;});
+  Dali::EraseIf(vector, [](const auto& value) { return value == 42; });
   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);