Revert "[Tizen] Fix TC code conflict"
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Vector.cpp
index fa185f5..c7fbe71 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -27,8 +27,21 @@ using namespace Dali;
 namespace
 {
 const Dali::VectorBase::SizeType ZERO(0);
+
+/// Compare a short with an int
+void DALI_TEST_EQUALS( short value1, int value2, const char* location )
+{
+  ::DALI_TEST_EQUALS< short >( value1, static_cast< short >( value2 ), location );
+}
+
+/// Compare a char with an int
+void DALI_TEST_EQUALS( char value1, int value2, const char* location )
+{
+  ::DALI_TEST_EQUALS< char >( value1, static_cast< char >( value2 ), location );
 }
 
+} // unnamed namespace
+
 int UtcDaliEmptyVectorInt(void)
 {
   tet_infoline("Testing Dali::Vector<int>");
@@ -1326,6 +1339,28 @@ int UtcDaliVectorMatrixP(void)
   END_TEST;
 }
 
+int UtcDaliVectorCpp11ForP(void)
+{
+  Vector< Vector3 > classvector;
+  for ( auto i : classvector )
+  {
+    std::ignore = i;
+    tet_result( TET_FAIL );
+  }
+
+  classvector.PushBack( Vector3( 0.1f, 0.2f, 0.3f ) );
+  classvector.PushBack( Vector3( 0.1f, 0.2f, 0.3f ) );
+  classvector.PushBack( Vector3( 0.1f, 0.2f, 0.3f ) );
+
+  for ( auto i : classvector )
+  {
+    DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), i, TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+
 /*
  * this does not compile at the moment
  * Vector< Actor > classvector; this does not compile yet either