21
21
#include "apr_file_info.h"
22
22
#include "apr_errno.h"
23
23
#include "apr_general.h"
24
- #include "apr_strings.h"
25
24
#include "apr_lib.h"
26
25
#include "apr_thread_proc.h"
27
26
#include "testutil.h"
@@ -431,66 +430,6 @@ static void test_readmore_info(abts_case* tc, void* data)
431
430
ABTS_INT_EQUAL (tc , APR_SUCCESS , rv );
432
431
}
433
432
434
- #if APR_POOL_DEBUG
435
- static void test_pread (abts_case * tc , void * data )
436
- {
437
- apr_dir_t * dir ;
438
- apr_finfo_t finfo ;
439
- apr_size_t before , after ;
440
- apr_pool_t * subp ;
441
-
442
- APR_ASSERT_SUCCESS (tc , "apr_dir_open failed" , apr_dir_open (& dir , "data" , p ));
443
-
444
- apr_pool_create (& subp , p );
445
-
446
- before = apr_pool_num_bytes (p , 0 );
447
-
448
- APR_ASSERT_SUCCESS (tc , "apr_dir_read failed" ,
449
- apr_dir_pread (& finfo , APR_FINFO_DIRENT , dir , subp ));
450
-
451
- after = apr_pool_num_bytes (p , 0 );
452
-
453
- ABTS_PTR_EQUAL (tc , finfo .pool , subp );
454
-
455
- apr_pool_destroy (subp );
456
-
457
- APR_ASSERT_SUCCESS (tc , "apr_dir_close failed" , apr_dir_close (dir ));
458
-
459
- ABTS_INT_EQUAL (tc , before , after );
460
-
461
- }
462
- #endif
463
-
464
- /* Ensure that apr_dir_read() doesn't have side-effects, because
465
- * finfo->name points to a static buffer inside the apr_dir_t */
466
- static void test_read_side_effects (abts_case * tc , void * data )
467
- {
468
- apr_dir_t * dir ;
469
- apr_finfo_t f1 ;
470
- apr_finfo_t f2 ;
471
- char name [APR_PATH_MAX ], fname [APR_PATH_MAX ];
472
-
473
- APR_ASSERT_SUCCESS (tc , "apr_dir_open failed" , apr_dir_open (& dir , "data" , p ));
474
-
475
- APR_ASSERT_SUCCESS (tc , "apr_dir_read failed" ,
476
- apr_dir_read (& f1 , APR_FINFO_DIRENT , dir ));
477
-
478
- if (f1 .name )
479
- apr_cpystrn (name , f1 .name , sizeof name );
480
- if (f1 .fname )
481
- apr_cpystrn (fname , f1 .fname , sizeof fname );
482
-
483
- APR_ASSERT_SUCCESS (tc , "second apr_dir_read failed" ,
484
- apr_dir_read (& f2 , APR_FINFO_DIRENT , dir ));
485
-
486
- if (f1 .name )
487
- ABTS_STR_EQUAL (tc , name , f1 .name );
488
- if (f1 .fname )
489
- ABTS_STR_EQUAL (tc , fname , f1 .fname );
490
-
491
- APR_ASSERT_SUCCESS (tc , "apr_dir_close failed" , apr_dir_close (dir ));
492
- }
493
-
494
433
abts_suite * testdir (abts_suite * suite )
495
434
{
496
435
suite = ADD_SUITE (suite )
@@ -512,11 +451,7 @@ abts_suite *testdir(abts_suite *suite)
512
451
abts_run_test (suite , test_closedir , NULL );
513
452
abts_run_test (suite , test_uncleared_errno , NULL );
514
453
abts_run_test (suite , test_readmore_info , NULL );
515
- #if APR_POOL_DEBUG
516
- abts_run_test (suite , test_pread , NULL );
517
- #endif
518
- abts_run_test (suite , test_read_side_effects , NULL );
519
-
454
+
520
455
return suite ;
521
456
}
522
457
0 commit comments