You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2014/01/30 22:35:52 UTC

svn commit: r1562984 - in /qpid/proton/trunk/proton-c/src/tests: CMakeLists.txt message.c

Author: kgiusti
Date: Thu Jan 30 21:35:51 2014
New Revision: 1562984

URL: http://svn.apache.org/r1562984
Log:
PROTON-500: enable valgrind on C unit tests

Modified:
    qpid/proton/trunk/proton-c/src/tests/CMakeLists.txt
    qpid/proton/trunk/proton-c/src/tests/message.c

Modified: qpid/proton/trunk/proton-c/src/tests/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/tests/CMakeLists.txt?rev=1562984&r1=1562983&r2=1562984&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/tests/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/src/tests/CMakeLists.txt Thu Jan 30 21:35:51 2014
@@ -23,6 +23,7 @@ set_target_properties (
   c-object-tests
   PROPERTIES
   COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
+  OUTPUT_NAME c-object-tests
   )
 pn_c_files (object.c)
 
@@ -32,8 +33,15 @@ set_target_properties (
   c-message-tests
   PROPERTIES
   COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
+  OUTPUT_NAME c-message-tests
   )
 pn_c_files (message.c)
 
-add_test (c-object-tests c-object-tests)
-add_test (c-message-tests c-message-tests)
+if (ENABLE_VALGRIND AND VALGRIND)
+  set(memcheck-cmd ${VALGRIND} --error-exitcode=1 --quiet
+                   --leak-check=full --trace-children=yes)
+endif (ENABLE_VALGRIND AND VALGRIND)
+
+add_test (c-object-tests ${memcheck-cmd} ./c-object-tests)
+add_test (c-message-tests ${memcheck-cmd} ./c-message-tests)
+

Modified: qpid/proton/trunk/proton-c/src/tests/message.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/tests/message.c?rev=1562984&r1=1562983&r2=1562984&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/tests/message.c (original)
+++ qpid/proton/trunk/proton-c/src/tests/message.c Thu Jan 30 21:35:51 2014
@@ -37,6 +37,7 @@ static void test_overflow_error(void)
   int err = pn_message_encode(message, buf, &size);
   assert(err == PN_OVERFLOW);
   assert(pn_message_errno(message) == 0);
+  pn_message_free(message);
 }
 
 int main(int argc, char **argv)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org