diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2002-12-29 20:55:22 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2002-12-29 20:55:22 +0000 |
commit | 2950e24f69fd9459d138c3ad88095be6e6a19816 (patch) | |
tree | 81e8a2018abd87d8d1612bb1d17feac40acfe26e /test | |
parent | 6adc2c5691a963674171ece9da3160529e5294fd (diff) | |
download | libapr-2950e24f69fd9459d138c3ad88095be6e6a19816.tar.gz |
Remove some code that we can never reach. If we fail the
CuAssertPtrEquals, the test suite will longjmp. If we pass it, then the
pointer is NULL, and we won't go to the internals of the if statement.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64230 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/testfile.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/test/testfile.c b/test/testfile.c index c6adad9fc..6fa6dbf73 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -81,9 +81,6 @@ static void test_open_noreadwrite(CuTest *tc) CuAssertTrue(tc, rv != APR_SUCCESS); CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv)); CuAssertPtrEquals(tc, NULL, thefile); - if (thefile) { - apr_file_close(thefile); - } } static void test_open_dir_read(CuTest *tc) @@ -97,9 +94,6 @@ static void test_open_dir_read(CuTest *tc) CuAssertTrue(tc, rv != APR_SUCCESS); CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv)); CuAssertPtrEquals(tc, NULL, thedir); - if (thedir) { - apr_file_close(thedir); - } } static void test_open_excl(CuTest *tc) @@ -113,9 +107,6 @@ static void test_open_excl(CuTest *tc) CuAssertTrue(tc, rv != APR_SUCCESS); CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv)); CuAssertPtrEquals(tc, NULL, thefile); - if (thefile) { - apr_file_close(thefile); - } } static void test_open_read(CuTest *tc) @@ -209,9 +200,7 @@ static void test_open_write(CuTest *tc) APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); - if (filetest) { - apr_file_close(filetest); - } + CuAssertPtrEquals(tc, NULL, filetest); } static void test_open_writecreate(CuTest *tc) |