(Third Party Tests) Ensure it builds & runs on Ubuntu 18.04 57/196457/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 28 Dec 2018 13:08:44 +0000 (13:08 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 28 Dec 2018 13:13:49 +0000 (13:13 +0000)
Had to use std::abort instead of return in the assert as some functions
using this assert have void returns, others do not and it produces an
error otherwise.

argc and argv cannot be 0 and nullptr as it seems it's now used within
gtest.

Change-Id: I305b16ba402b7f7066584959fc7a8252e099abcd

automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp

index 832d73e..465e7f3 100644 (file)
@@ -15,6 +15,8 @@
  *
  */
 
+#include <cstdlib>
+
 #include <dali-toolkit-test-suite-utils.h>
 // GTest fails to compile with "error: return-statement with a value, in function returning 'void'" error
 // if using dali assert function so define new assert with returning void.
@@ -26,7 +28,7 @@
         fprintf(stderr, \
             "Following expression is not true:\n" \
                 "%s\n", #exp); \
-        return; \
+        std::abort(); \
     }
 #include <gtest/gtest.h>
 #undef GTEST_HAS_DEATH_TEST
 
 int UtcDaliFlexboxLayoutTest(void)
 {
-  ToolkitTestApplication application;
   tet_infoline("UtcDaliFlexboxLayoutTest");
-  int argc = 0;
-  testing::InitGoogleTest( &argc, static_cast<char**>(nullptr) );
+  int argc = 1;
+  const char* argv = "yoga-gtest";
+  testing::InitGoogleTest( &argc,  const_cast< char** >( &argv ) );
 
   // The test function is a 3rd party function that should return true if the test passes
   if( !RUN_ALL_TESTS() )