You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by bl...@apache.org on 2010/12/28 02:59:25 UTC
svn commit: r1053241 -
/subversion/branches/1.6.x-r1051744/subversion/tests/svn_test.h
Author: blair
Date: Tue Dec 28 01:59:24 2010
New Revision: 1053241
URL: http://svn.apache.org/viewvc?rev=1053241&view=rev
Log:
On the 1.6.x-r1051744 branch: add the definition of SVN_TEST_ASSERT
which is not yet in this branch. There are no clean merges of this
definition, so I copied it in.
* subversion/tests/svn_test.h
(SVN_TEST_ASSERT):
New definition copied from trunk r1053238.
Modified:
subversion/branches/1.6.x-r1051744/subversion/tests/svn_test.h
Modified: subversion/branches/1.6.x-r1051744/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x-r1051744/subversion/tests/svn_test.h?rev=1053241&r1=1053240&r2=1053241&view=diff
==============================================================================
--- subversion/branches/1.6.x-r1051744/subversion/tests/svn_test.h (original)
+++ subversion/branches/1.6.x-r1051744/subversion/tests/svn_test.h Tue Dec 28 01:59:24 2010
@@ -35,6 +35,17 @@ extern "C" {
#endif /* __cplusplus */
+/** Handy macro to test a condition, returning SVN_ERR_TEST_FAILED if FALSE
+ *
+ * This macro should be used in place of SVN_ERR_ASSERT() since we don't
+ * want to core-dump the test.
+ */
+#define SVN_TEST_ASSERT(expr) \
+ do { \
+ if (!(expr)) \
+ return svn_error_create(SVN_ERR_TEST_FAILED, NULL, #expr); \
+ } while (0)
+
/* Baton for any arguments that need to be passed from main() to svn
* test functions.
*/