From 72c686167dfa5836191068aa475b73a1bf5daca1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Dec 2012 14:44:42 +0100 Subject: libblock: Use rtems_blkdev_create_partition() Use rtems_blkdev_create_partition() instead of rtems_disk_create_log() to avoid problems with the huge IMFS_GENERIC_DEVICE_MAJOR_NUMBER. --- testsuites/fstests/fsbdpart01/init.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'testsuites') diff --git a/testsuites/fstests/fsbdpart01/init.c b/testsuites/fstests/fsbdpart01/init.c index 3539a05359..aea0da08d1 100644 --- a/testsuites/fstests/fsbdpart01/init.c +++ b/testsuites/fstests/fsbdpart01/init.c @@ -25,6 +25,7 @@ #include #include #include +#include #define ASSERT_SC(sc) rtems_test_assert((sc) == RTEMS_SUCCESSFUL) @@ -99,12 +100,27 @@ static void test_logical_disks(const char *const *rdax, bool exists) } } +static void initialize_swapout_task(void) +{ + int fd = open(rda, O_RDONLY); + int rv = 0; + + rtems_test_assert(fd >= 0); + + rv = rtems_disk_fd_sync(fd); + rtems_test_assert(rv == 0); + + rv = close(fd); + rtems_test_assert(rv == 0); +} + static void test_bdpart(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_bdpart_partition created_partitions [PARTITION_COUNT]; rtems_bdpart_format actual_format; rtems_bdpart_partition actual_partitions [PARTITION_COUNT]; + rtems_resource_snapshot before; size_t actual_count = PARTITION_COUNT; size_t i = 0; @@ -112,6 +128,10 @@ static void test_bdpart(void) memset(&actual_format, 0, sizeof(actual_format)); memset(&actual_partitions [0], 0, sizeof(actual_partitions)); + initialize_swapout_task(); + + rtems_resource_snapshot_take(&before); + for (i = 0; i < PARTITION_COUNT; ++i) { rtems_bdpart_to_partition_type( RTEMS_BDPART_MBR_FAT_32, @@ -168,6 +188,8 @@ static void test_bdpart(void) ASSERT_SC(sc); test_logical_disks(&bdpart_rdax [0], false); + rtems_test_assert(rtems_resource_snapshot_check(&before)); + sc = rtems_bdpart_register_from_disk(rda); ASSERT_SC(sc); test_logical_disks(&bdpart_rdax [0], true); @@ -180,6 +202,8 @@ static void test_bdpart(void) ASSERT_SC(sc); test_logical_disks(&bdpart_rdax [0], false); + rtems_test_assert(rtems_resource_snapshot_check(&before)); + rtems_bdpart_dump(&actual_partitions [0], actual_count); } @@ -216,13 +240,13 @@ size_t rtems_ramdisk_configuration_size = 1; #define CONFIGURE_APPLICATION_EXTRA_DRIVERS RAMDISK_DRIVER_TABLE_ENTRY #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 13 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM #define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024) +#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -- cgit v1.2.3