From 854d50fd146a9b28d138d563929b04485a824893 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Wed, 18 Sep 2019 17:43:59 +0900 Subject: [PATCH] [Tests/Plugins] Avoid warnings caused by a GCC bug related to gtest A GCC bug [1] might cause warnings related to 'conversion-null' when using googletest macros with !FALSE as arguments. Therefore, in the case that Werror is true, the build would be broken by this bug. To avoid such situation, this patch replaces EXPECT_EQs in the plugin unit tests with EXPECT_TRUE or EXPECT_FALSE. [1] https://github.com/google/googletest/issues/322 Signed-off-by: Wook Song --- tests/nnstreamer_plugins/unittest_plugins.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/nnstreamer_plugins/unittest_plugins.cpp b/tests/nnstreamer_plugins/unittest_plugins.cpp index c0380e3..7e7be8d 100644 --- a/tests/nnstreamer_plugins/unittest_plugins.cpp +++ b/tests/nnstreamer_plugins/unittest_plugins.cpp @@ -141,7 +141,8 @@ TEST (test_tensor_transform, properties) g_object_set (transform, "silent", !default_silent, NULL); g_object_get (transform, "silent", &res_silent, NULL); - EXPECT_EQ (!default_silent, res_silent); + /** expect FALSE, which is !default_silent */ + EXPECT_FALSE (res_silent); /** * If HAVE_ORC is set, default acceleration is TRUE. @@ -153,7 +154,8 @@ TEST (test_tensor_transform, properties) #ifdef HAVE_ORC g_object_set (transform, "acceleration", !default_accl, NULL); g_object_get (transform, "acceleration", &accl, NULL); - EXPECT_EQ (!default_accl, accl); + /** expect FALSE, which is !default_accl */ + EXPECT_FALSE (accl); #endif /** We do not need to test setting properties for 'mode' and 'option' */ -- 2.7.4