From 42e4cf9ae32b559f921eed60bfdecaf72ae3c216 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Fri, 28 Dec 2018 13:08:44 +0000 Subject: [PATCH] (Third Party Tests) Ensure it builds & runs on Ubuntu 18.04 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 --- .../src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp b/automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp index 832d73e..465e7f3 100644 --- a/automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp +++ b/automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp @@ -15,6 +15,8 @@ * */ +#include + #include // 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 #undef GTEST_HAS_DEATH_TEST @@ -76,10 +78,10 @@ int UtcDaliFlexboxLayoutTest(void) { - ToolkitTestApplication application; tet_infoline("UtcDaliFlexboxLayoutTest"); - int argc = 0; - testing::InitGoogleTest( &argc, static_cast(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() ) -- 2.7.4