celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] pnoltes commented on a change in pull request #168: Refactors dfi tests from cpputest to google test
Date Wed, 11 Mar 2020 18:54:03 GMT
pnoltes commented on a change in pull request #168: Refactors dfi tests from cpputest to google
test
URL: https://github.com/apache/celix/pull/168#discussion_r391192655
 
 

 ##########
 File path: libs/dfi/gtest/src/dyn_avpr_function_tests.cpp
 ##########
 @@ -219,27 +219,32 @@ const char* theAvprFile = "{ \
                 }\
             }";
 
-TEST_GROUP(DynAvprFunctionTests) {
-    void setup() override {
+
+class DynAvprFunctionTests : public ::testing::Test {
+public:
+    DynAvprFunctionTests() {
         int lvl = 1;
         dynAvprFunction_logSetup(stdLog, nullptr, lvl);
         dynAvprType_logSetup(stdLog, nullptr, lvl);
     }
+    ~DynAvprFunctionTests() override {
+    }
+
 };
 
 // Test 1, simple function with three arguments and a return type
 static int avpr_example1(__attribute__((unused)) void* handle, int32_t a, int32_t b, int32_t
c, int32_t * out) {
-    CHECK_EQUAL(2, a);
-    CHECK_EQUAL(4, b);
-    CHECK_EQUAL(8, c);
+    EXPECT_EQ(2, a);
 
 Review comment:
   A google test ASSERT_ is like cpputest CHECK_ . An failed EXPECT_ will fail the result
of the test, but will continue running the rest of the test.
   The reason why sometimes I replace CHECK_ with EXPECT instead of ASSERT_ is that ASSERT_
are not always allowed in "plain" c functions (compile error). If I am correct it has to do
with exceptions. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message