subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1445516 - in /subversion/trunk/subversion/tests: libsvn_subr/subst_translate-test.c libsvn_wc/db-test.c libsvn_wc/op-depth-test.c libsvn_wc/pristine-store-test.c
Date Wed, 13 Feb 2013 09:27:24 GMT
Author: philip
Date: Wed Feb 13 09:27:24 2013
New Revision: 1445516

URL: http://svn.apache.org/r1445516
Log:
Use SVN_TEST_ASSERT_ERROR macro rather than coding the error comparison.

* subversion/tests/libsvn_subr/subst_translate-test.c
  (test_svn_subst_translate_string2): Use macro.

* subversion/tests/libsvn_wc/db-test.c
  (test_getting_info): Use macro.

* subversion/tests/libsvn_wc/op-depth-test.c
  (test_op_revert, copy_wc_wc_server_excluded, layered_moved_to,
   update_within_move): Use macro.

* subversion/tests/libsvn_wc/pristine-store-test.c
  (pristine_write_read, reject_mismatching_text): Use macro.

Modified:
    subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
    subversion/trunk/subversion/tests/libsvn_wc/db-test.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1445516&r1=1445515&r2=1445516&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c Wed Feb 13 09:27:24
2013
@@ -96,9 +96,7 @@ test_svn_subst_translate_string2(apr_poo
                                                      source_string,
                                                      "ISO-8859-1", FALSE, pool,
                                                      pool);
-      SVN_TEST_ASSERT(err != SVN_NO_ERROR);
-      SVN_TEST_ASSERT(err->apr_err == SVN_ERR_IO_INCONSISTENT_EOL);
-      svn_error_clear(err);
+      SVN_TEST_ASSERT_ERROR(err, SVN_ERR_IO_INCONSISTENT_EOL);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=1445516&r1=1445515&r2=1445516&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Wed Feb 13 09:27:24 2013
@@ -546,8 +546,7 @@ test_getting_info(apr_pool_t *pool)
             NULL, NULL, NULL, NULL,
             db, svn_dirent_join(local_abspath, "missing-file", pool),
             pool, pool);
-  SVN_TEST_ASSERT(err != NULL && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND);
-  svn_error_clear(err);
+  SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_PATH_NOT_FOUND);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1445516&r1=1445515&r2=1445516&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Wed Feb 13 09:27:24 2013
@@ -2032,12 +2032,10 @@ test_op_revert(const svn_test_opts_t *op
                    before, before, before_actual4, after_actual4));
     err = revert(&b, "A/B", svn_depth_empty,
                  before, before, common_actual5, common_actual5);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
     err = revert(&b, "A/B/C", svn_depth_empty,
                  before, before, common_actual6, common_actual6);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
   }
 
   {
@@ -2090,30 +2088,24 @@ test_op_revert(const svn_test_opts_t *op
 
     err = revert(&b, "A/B", svn_depth_empty,
                  common, common, NULL, NULL);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
     err = revert(&b, "A/B", svn_depth_empty,
                  common, common, common_actual, common_actual);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
 
     err = revert(&b, "P", svn_depth_empty,
                  common, common, NULL, NULL);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
     err = revert(&b, "P", svn_depth_empty,
                  common, common, common_actual, common_actual);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
 
     err = revert(&b, "X", svn_depth_empty,
                  common, common, NULL, NULL);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
     err = revert(&b, "X", svn_depth_empty,
                  common, common, common_actual, common_actual);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
   }
 
   {
@@ -2314,8 +2306,7 @@ test_op_revert(const svn_test_opts_t *op
     };
     err = revert(&b, "A", svn_depth_empty,
                  common, common, NULL, NULL);
-    SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_INVALID_OPERATION_DEPTH);
   }
 
   {
@@ -3512,8 +3503,7 @@ copy_wc_wc_server_excluded(const svn_tes
   SVN_ERR(check_db_rows(&b, "", before));
   SVN_ERR(sbox_disk_mkdir(&b, "A"));
   err = sbox_wc_copy(&b, "A", "X");
-  SVN_TEST_ASSERT(err && err->apr_err == SVN_ERR_WC_PATH_UNEXPECTED_STATUS);
-  svn_error_clear(err);
+  SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_PATH_UNEXPECTED_STATUS);
   SVN_ERR(check_db_rows(&b, "", after));
 
   return SVN_NO_ERROR;
@@ -6362,8 +6352,7 @@ layered_moved_to(const svn_test_opts_t *
   /* Cannot resolve C */
   err = sbox_wc_resolve(&b, "C", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
-  SVN_ERR_ASSERT(err && err->apr_err == SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
-  svn_error_clear(err);
+  SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
 
   /* Complete resolving A and then resolve C */
   SVN_ERR(sbox_wc_resolve(&b, "X/B/C/D/E", svn_depth_empty,
@@ -6450,8 +6439,7 @@ update_within_move(const svn_test_opts_t
   /* Can't resolve mixed-revision source to mine-conflict. */
   err = sbox_wc_resolve(&b, "A", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
-  SVN_ERR_ASSERT(err && err->apr_err == SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
-  svn_error_clear(err);
+  SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
 
   SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
                           svn_wc_conflict_choose_merged));

Modified: subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1445516&r1=1445515&r2=1445516&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c Wed Feb 13 09:27:24
2013
@@ -187,8 +187,7 @@ pristine_write_read(const svn_test_opts_
     SVN_ERR(svn_wc__db_pristine_remove(db, wc_abspath, data_sha1, pool));
     err = svn_wc__db_pristine_read(&data_read_back, NULL, db, wc_abspath,
                                    data_sha1, pool, pool);
-    SVN_TEST_ASSERT(err != NULL);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_PATH_NOT_FOUND);
   }
 
   /* Ensure it's no longer found in the store. */
@@ -308,9 +307,7 @@ reject_mismatching_text(const svn_test_o
     SVN_ERR(write_and_checksum_temp_file(&path, NULL, NULL,
                                          data2, pristine_tmp_dir, pool));
     err = svn_wc__db_pristine_install(db, path, data_sha1, data_md5, pool);
-    SVN_TEST_ASSERT(err != NULL);
-    SVN_TEST_ASSERT(err->apr_err == SVN_ERR_WC_CORRUPT_TEXT_BASE);
-    svn_error_clear(err);
+    SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CORRUPT_TEXT_BASE);
   }
 
   return SVN_NO_ERROR;



Mime
View raw message