subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1716808 - /subversion/trunk/subversion/tests/svn_test.h
Date Fri, 27 Nov 2015 09:24:41 GMT
Author: rhuijben
Date: Fri Nov 27 09:24:41 2015
New Revision: 1716808

URL: http://svn.apache.org/viewvc?rev=1716808&view=rev
Log:
* subversion/tests/svn_test.h
  (SVN_TEST_INT_ASSERT): New define. Similar to the existing
    SVN_TEST_STRING_ASSERT.

Modified:
    subversion/trunk/subversion/tests/svn_test.h

Modified: subversion/trunk/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test.h?rev=1716808&r1=1716807&r2=1716808&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test.h (original)
+++ subversion/trunk/subversion/tests/svn_test.h Fri Nov 27 09:24:41 2015
@@ -131,6 +131,22 @@ extern "C" {
           tst_str2, tst_str1, __FILE__, __LINE__);                  \
   } while(0)
 
+ /** Handy macro for testing integer equality.
+  */
+#define SVN_TEST_INT_ASSERT(expr, expected_expr)                  \
+  do {                                                            \
+    apr_int64_t tst_int1 = (expr);                                \
+    apr_int64_t tst_int2 = (expected_expr);                       \
+                                                                  \
+    if (tst_int1 != tst_int2)                                     \
+      return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,         \
+          "Integers not equal\n"                                  \
+          "  Expected: %" APR_INT64_T_FMT "\n"                    \
+          "     Found: %" APR_INT64_T_FMT "\n"                    \
+          "\n  at %s:%d",                                         \
+          tst_int2, tst_int1, __FILE__, __LINE__);                \
+  } while(0)
+
 
 /* Baton for any arguments that need to be passed from main() to svn
  * test functions.



Mime
View raw message