From ac741625b0926a0329627beca52174edd69e587b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 14 Sep 2017 15:21:14 +0200 Subject: libio: Use FIFO for iop free list Update #3136. --- testsuites/fstests/fsclose01/init.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'testsuites/fstests') diff --git a/testsuites/fstests/fsclose01/init.c b/testsuites/fstests/fsclose01/init.c index a9de652b51..77df082036 100644 --- a/testsuites/fstests/fsclose01/init.c +++ b/testsuites/fstests/fsclose01/init.c @@ -405,6 +405,27 @@ static void worker_task(rtems_task_argument arg) } } +static void test_fd_free_fifo(const char *path) +{ + int a; + int b; + int rv; + + a = open(path, O_RDWR); + rtems_test_assert(a >= 0); + + rv = close(a); + rtems_test_assert(rv == 0); + + b = open(path, O_RDWR); + rtems_test_assert(b >= 0); + + rv = close(b); + rtems_test_assert(rv == 0); + + rtems_test_assert(a != b); +} + static void test(test_context *ctx) { const char *path = "generic"; @@ -420,6 +441,8 @@ static void test(test_context *ctx) ); rtems_test_assert(rv == 0); + test_fd_free_fifo(path); + sc = rtems_task_create( rtems_build_name('W', 'O', 'R', 'K'), 1, @@ -469,15 +492,15 @@ static void test(test_context *ctx) rv = unlink(path); rtems_test_assert(rv == 0); - rtems_test_assert(ctx->close_count == 15); + rtems_test_assert(ctx->close_count == 17); rtems_test_assert(ctx->fcntl_count == 1); rtems_test_assert(ctx->fdatasync_count == 1); - rtems_test_assert(ctx->fstat_count == 38); + rtems_test_assert(ctx->fstat_count == 42); rtems_test_assert(ctx->fsync_count == 1); rtems_test_assert(ctx->ftruncate_count == 1); rtems_test_assert(ctx->ioctl_count == 1); rtems_test_assert(ctx->lseek_count == 1); - rtems_test_assert(ctx->open_count == 15); + rtems_test_assert(ctx->open_count == 17); rtems_test_assert(ctx->read_count == 1); rtems_test_assert(ctx->readv_count == 1); rtems_test_assert(ctx->write_count == 1); @@ -495,7 +518,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5 #define CONFIGURE_MAXIMUM_TASKS 2 -- cgit v1.2.3